Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. $(function () { // same as $(document).read(...)
  2. // declare some "constants"
  3. var animationDelay = 800,
  4. animationDuration = 1000;
  5.  
  6. // setup all the animations
  7. var queue = $(".elm").each(function (i) {
  8. $(this).delay(i * animationDelay).animate({opacity: 0}, {duration: animationDuration});
  9. });
  10.  
  11. // set up the callback for when they finish
  12. $.when(queue).then(function () {
  13. // all animations done
  14. });
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement