Skip to content

Instantly share code, notes, and snippets.

@gregpalaci
Created May 26, 2013 10:19
Show Gist options
  • Save gregpalaci/5652346 to your computer and use it in GitHub Desktop.
Save gregpalaci/5652346 to your computer and use it in GitHub Desktop.
Using Jquery Promise for callback after animations
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