Skip to content

Instantly share code, notes, and snippets.

@adamjmcintyre
Created July 12, 2012 15:15
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save adamjmcintyre/3098766 to your computer and use it in GitHub Desktop.
Save adamjmcintyre/3098766 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');
});
@mspanish
Copy link

Thanks for this, other animationend samples didn't work and yours works like a charm.

@newshorts
Copy link

thanks

@eahang
Copy link

eahang commented Nov 5, 2015

it works thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment