jQuery toggle animate


/ Published in: jQuery
Save to your folder(s)

Just leaving this here for my own reference ;)


Copy this code and paste it in your HTML
  1. $(document).ready(function(){
  2.  
  3. $('#clickme').toggle(
  4. function(){
  5. $('#animateme').animate({marginLeft: "250"}, 1000);
  6. },
  7. function(){
  8. $('#animateme').animate({marginLeft: "0"}, 1000);
  9. });
  10. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.