Jump to content

I.E problem who would have guessed it!


shaunno2007

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/158391-ie-problem-who-would-have-guessed-it/
Share on other sites

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

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")
}
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.