Looped animation


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



Copy this code and paste it in your HTML
  1. function loopAnimation() {
  2. $('.element').animate({
  3. marginTop: '+=20',
  4. }, 500, function() {
  5. $('#window').animate({
  6. marginTop: '-=20',
  7. }, 500, function() {
  8. loopAnimation()
  9. });
  10. });
  11. }
  12.  
  13. loopAnimation()

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.