Created
February 20, 2018 15:53
-
-
Save adamcjoiner/93015cd5aae0943100222b4ca8b9f0cc to your computer and use it in GitHub Desktop.
Add CSS animation to element and then reset it (to animate it again)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#btn-animate').click(function() { | |
// Shake the 'Codes' dropdown | |
animEl = $('#dropdown-codes'); | |
animEl.addClass('shake animated'); // ~add the anim. CSS class | |
animEl.one('webkitAnimationEnd oanimationend msAnimationEnd animationend', function (e) { | |
animEl.removeClass('shake animated'); // ~remove it when finished | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment