animations.js 563 B

12345678910111213141516
  1. $(function () {
  2. $('.js-animations').bind('change', function () {
  3. var animation = $(this).val();
  4. $('.js-animating-object').animateCss(animation);
  5. });
  6. });
  7. //Copied from https://github.com/daneden/animate.css
  8. $.fn.extend({
  9. animateCss: function (animationName) {
  10. var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
  11. $(this).addClass('animated ' + animationName).one(animationEnd, function() {
  12. $(this).removeClass('animated ' + animationName);
  13. });
  14. }
  15. });