forked from ncou/jquery-animateCSS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery.animateCSS.min.js
9 lines (9 loc) · 1.33 KB
/
jquery.animateCSS.min.js
1
2
3
4
5
6
7
8
9
//
// jquery.animatecss.js - A micro-plugin for using Animate.css with jQuery.
//
// Developed by Cory LaViska for A Beautiful Site, LLC
//
// Licensed under the MIT license: http://opensource.org/licenses/MIT
//
/* global define */
!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(i,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(i)),n(t),t}:n(jQuery)}(function(n){"use strict";function i(i,t){var o="animationend mozAnimationEnd MSAnimationEnd oanimationend webkitAnimationEnd";n(i).addClass("animated "+t.animation).on(o,function(){n(this).off(o),n(i).removeClass("animated "+t.animation),t.complete.call(i)})}n.fn.animateCSS=function(t){var o={};return"object"==typeof arguments[1]?o=arguments[1]:"function"==typeof arguments[1]?o.complete=arguments[1]:"number"==typeof arguments[1]&&(o.duration=arguments[1],"function"==typeof arguments[2]&&(o.complete=arguments[2])),o=n.extend(!0,{animation:t,complete:function(){},delay:0,duration:1e3},o),n(this).each(function(){var t=this;o.duration&&n(t).css({"-moz-animation-duration":o.duration+"ms","-o-animation-duration":o.duration+"ms","-webkit-animation-duration":o.duration+"ms","animation-duration":o.duration+"ms"}),o.delay<=0?i(t,o):setTimeout(function(){i(t,o)},o.delay)}),this}});