Created
May 26, 2013 10:19
-
-
Save jswhisperer/5652346 to your computer and use it in GitHub Desktop.
Using Jquery Promise for callback after animations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var items = $('.element'); | |
items.animate( | |
{opacity:0}, | |
{ | |
duration:2000, | |
complete: function(){ | |
// This would be called on each item | |
} | |
} | |
); | |
items.promise(function() { | |
// This will be called after all items faded | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment