-
Notifications
You must be signed in to change notification settings - Fork 16
/
jquery.jcslider.min.js
1 lines (1 loc) · 982 Bytes
/
jquery.jcslider.min.js
1
!function(n,e,i,o){"use strict";n.fn.jcSlider=function(i){function t(){var n,i=e.createElement("fakeelement"),t={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(n in t)if(i.style[n]!==o)return t[n]}var a=n(this);a.css({overflow:"hidden"}),a.find(".jc-animation:not(:first)").hide();var d=n.extend({animationIn:"bounceInRight",animationOut:"bounceOutLeft",stopOnHover:!0,loop:!0},i),r="animated "+d.animationOut,m="animated "+d.animationIn,l=a.find(".jc-animation"),u=l.length,s=0,c=null,f=t(),v=function(){c=setInterval(function(){d.loop===!1&&s==u-2&&clearInterval(c),l.eq(s).removeClass(m).addClass(r).one(f,function(){l.eq(s).removeClass(r).hide(),s++,s==u&&(s=0),l.eq(s).show().addClass(m)})},4e3)};v(),d.stopOnHover===!0&&a.hover(function(){clearInterval(c)},function(){v()})}}(window.jQuery||window.Zepto||window.$,document,window),"undefined"!=typeof module&&module.exports&&(module.exports=jcSlider);