Jquery Chained Animation On Hover


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

This is the syntax for a chained animation on hover. The included animations probably aren't very useful, but could easily be changed out with addClass or other css attributes... Or other animations of other properties. God, I don't know. I hope some lucky bastard finds this useful.


Copy this code and paste it in your HTML
  1. $('a').hover(function(){
  2. $(this).animate({'paddingLeft':'15px'},{queue:false,duration:120,complete: function(){
  3. $(this).animate({'marginBottom':'15px'},{queue:false,duration:120});
  4. }
  5. });
  6. },function(){
  7. $(this).animate({'paddingLeft':'0px'},{queue:false,duration:120,complete: function(){
  8. $(this).animate({'marginBottom':'0px'},{queue:false,duration:120});
  9. }
  10. });
  11. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.