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
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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.