Toggle Image using jquery? -
here's simpler code. sorry, i'm new here.
if loginbutton clicked. show down login container. please help. thanks.
<html> <head> <script> $(document).ready(function(){ $("#login").click(function(){ $("#login_container").slidetoggle("500"); }); }); </script> <style> #login { background-image:url(images/loginbutton.jpg); width:65px; height:22px; float:left; } #login_container { background-image:url(images/logincontainer.jpg); } </style> </head> <body> <div id="login"> <div id="login_container"> </body> </html>
there's nothing wrong code. sure have added jquery file in code?
plus recommend add "display: none" .login_container. or use hide(), this:
$('.login_container').hide(); $('.login').click(function() { $('.login_container').slidetoggle(500); });
Comments
Post a Comment