Skip to content

Instantly share code, notes, and snippets.

@marioblas
Last active August 29, 2015 14:12
Show Gist options
  • Save marioblas/306c8de3ff77b2b9b1e8 to your computer and use it in GitHub Desktop.
Save marioblas/306c8de3ff77b2b9b1e8 to your computer and use it in GitHub Desktop.
jQuery - Detect the completion of an animation/transition
$('#foo').on('webkitAnimationEnd mozAnimationEnd animationend', function() {
// Do something after animation...
});
// Note: transitionend fires for each property transitioned!
// mozTransitionEnd?
// oTransitionEnd for old Opera
$('#bar').on('webkitTransitionEnd mozTransitionEnd otransitionend oTransitionEnd transitionend', function() {
// Do something after transition...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment