jQuery animate Toggle

Posted by danit on Stack Overflow See other posts from Stack Overflow or by danit
Published on 2010-04-27T12:54:59Z Indexed on 2010/04/27 13:03 UTC
Read the original article Hit count: 127

Filed under:

Here is my code so far:

 $(document).ready(function(){
     $("#slider").click(function() {
         $("#insight").animate({ top: "25px",}, 300, function() {
              $("#insight").animate({ top: "89px",}, 300);
         });
     });
 });

I want this to act like .toggle(), where by on click #div1 slides up to top:25px and then stops, but when clicked again slides down to top:89px.

Can anyone expand the function above to achieve this?

© Stack Overflow or respective owner

Related posts about jQuery