$("#RightMenu").click(function() {
var img1 = '<img src="./MediumImages/Right-Menu-Icon_IPad.png">';
var img2 = '<img src="./MediumImages/Close-Icon_IPad.png">';
var img = $(this).html();
if(img == img1) {
$(this).html(img2);
$("#menu_hidden").show();
}
else {
$(this).html(img1);
$("#menu_hidden").hide();
}
$(".left_hidden_menu").hide();
$("#LeftMenu").html('<img src="./MediumImages/Left-Menu-Icon_IPad.png">');
});
$("#LeftMenu").click(function() {
var img1 = '<img src="./MediumImages/Left-Menu-Icon_IPad.png">';
var img2 = '<img src="./MediumImages/Close-Icon_IPad.png">';
var img = $(this).html();
if(img == img1) {
$(this).html(img2);
$(".left_hidden_menu").show();
}
else {
$(this).html(img1);
$(".left_hidden_menu").hide();
}
$("#menu_hidden").hide();
$("#RightMenu").html('<img src="./MediumImages/Right-Menu-Icon_IPad.png">');
});
$(document).mouseup(function (e) {
var container = $("#menu_hidden");
if (!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0) // ... nor a descendant of the container
{
container.hide();
}
var container1 = $(".left_hidden_menu");
if (!container1.is(e.target) // if the target of the click isn't the container...
&& container1.has(e.target).length === 0) // ... nor a descendant of the container
{
container1.hide();
}
});
I'm trying to change the image from
if (!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0) // ... nor a descendant of the container
{
var img = $("#RightMenu").html();
if(img == img1) {
$(this).html(img2);
container.hide();
}
But when i added this code the container always stay closed , I've used a code for the opening
$("#RightMenu").click(function() {
var img1 = '<img src="./MediumImages/Right-Menu-Icon_IPad.png">';
var img2 = '<img src="./MediumImages/Close-Icon_IPad.png">';
var img = $(this).html();
if(img == img1) {
$(this).html(img2);
else
$(this).html(img1);
$("#menu_hidden").toggle;
$(".left_hidden_menu").hide();
$("#LeftMenu").html('<img src="./MediumImages/Left-Menu-Icon_IPad.png">');
});
but the toggle function stoped working is there any solution ?

New Topic/Question
Reply


MultiQuote


|