Skip to content

Instantly share code, notes, and snippets.

@mklickman
Last active December 17, 2015 09:39
Show Gist options
  • Save mklickman/5589252 to your computer and use it in GitHub Desktop.
Save mklickman/5589252 to your computer and use it in GitHub Desktop.
// Attatch an event listener to your element for when the first animation
// finishes, but only when it's named for the first animation
$('.my-element').on('animationend', function() {
if ($(this).css('animation-name') == "animation-1") {
// Change the CSS animation-name property for the 2nd animation
$(this).css('animation-name', 'animation-2');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment