shaunno2007 Posted May 16, 2009 Share Posted May 16, 2009 Okay fine in FF but I.E don't work I really do hate I.E :/ Anyway just seeing if you can help me here is the code: Code: $("#accessmenu_close_hide").click(function(){ if(document.getElementById("accessmenu_close_hide_link").innerHTML == '<img src="images/lock_48.png" width="20" border="0" height="20">') { $("#accessmenu_close_hide").animate({ marginRight: "10px" }, 0400 ); $("#accessmenu_close_hide_link").html('<img src="images/lock_open_48.png" width="20" height="20" border="0" />'); $("#accessmenu").fadeIn("normal"); }else{ $("#accessmenu_close_hide").animate({ marginRight: "-2px" }, 0400 ); $("#accessmenu_close_hide_link").html('<img src="images/lock_48.png" width="20" height="20" border="0" />'); $("#accessmenu").fadeOut("normal") }; }); Thank you Shaun Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 16, 2009 Share Posted May 16, 2009 That is a pretty bad way to do something. The image never change. Why do that? I believe IE tags are in Caps. Though I would highly recommend you to take a new approach. Quote Link to comment Share on other sites More sharing options...
shaunno2007 Posted May 16, 2009 Author Share Posted May 16, 2009 hmm okay.. what would be the best way to do this then cos am stuck lol.. thanks Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 16, 2009 Share Posted May 16, 2009 *Ken2k7 shrugs Please describe what you are trying to do. Quote Link to comment Share on other sites More sharing options...
shaunno2007 Posted May 17, 2009 Author Share Posted May 17, 2009 If the div "#accessmenu_close_hide" is clicked then i want it to do the if statement so then when it is clicked it will check if the html in the "#accessmenu_close_hide" div is "<img src="images/lock_48.png" width="20" border="0" height="20">" if it is then i want it to do the if statement if not then i want it the else statement do you no what i mean? thanks Shaun Quote Link to comment Share on other sites More sharing options...
shaunno2007 Posted May 18, 2009 Author Share Posted May 18, 2009 ??? ??? ??? Quote Link to comment Share on other sites More sharing options...
Darghon Posted May 18, 2009 Share Posted May 18, 2009 not sure if this is the cleanest solution, but it should to the trick all you have to do is give the id accessmenu_close_hide_image to your image that you want to change $("#accessmenu_close_hide").onclick = function(){ if($("accessmenu_close_hide_image").src == "images/lock_48.png"){ $("#accessmenu_close_hide").animate({ marginRight: "10px" }, 0400 ); $("accessmenu_close_hide_image").src == "images/lock_open_48.png"; $("#accessmenu").fadeIn("normal"); } else{ $("#accessmenu_close_hide").animate({ marginRight: "-2px" }, 0400 ); $("#accessmenu_close_hide_image").src = "images/lock_48.png"; $("#accessmenu").fadeOut("normal") } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.