Skip to content

Instantly share code, notes, and snippets.

@raglan-road
Forked from adamjmcintyre/gist:3098766
Created August 4, 2012 15:08
Show Gist options
  • Save raglan-road/3258270 to your computer and use it in GitHub Desktop.
Save raglan-road/3258270 to your computer and use it in GitHub Desktop.
Using CSS keyframe animationend event cross-browser with jQuery
$('.some-els').bind('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function(){
// Do something!
$(this).removeClass('animation-class');
})
.addClass('animation-class');
// One works, too
$('.some-els').one('animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd', function(){
// Do something once!
console.log('this would show once');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment