Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function () { // same as $(document).read(...)
- // declare some "constants"
- var animationDelay = 800,
- animationDuration = 1000;
- // setup all the animations
- var queue = $(".elm").each(function (i) {
- $(this).delay(i * animationDelay).animate({opacity: 0}, {duration: animationDuration});
- });
- // set up the callback for when they finish
- $.when(queue).then(function () {
- // all animations done
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement