Skip to content

Instantly share code, notes, and snippets.

@paulozoom
Created February 24, 2014 15:25
Show Gist options
  • Save paulozoom/9190347 to your computer and use it in GitHub Desktop.
Save paulozoom/9190347 to your computer and use it in GitHub Desktop.
Animate.css jQuery plugin
(function($) {
$.fn.animateCss = function(animation, onEndCallback) {
return this.each(function() {
$(this)
.addClass("animated "+animation)
.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() {
$(this).removeClass(animation);
if (typeof onEndCallback === 'function') { onEndCallback(); }
});
});
}
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment