Skip to content

Instantly share code, notes, and snippets.

@drinks
Created June 28, 2010 13:56
Show Gist options
  • Save drinks/455870 to your computer and use it in GitHub Desktop.
Save drinks/455870 to your computer and use it in GitHub Desktop.
/* jQuery Cycle 2.88 */
(function(d){function h(a){d.fn.cycle.debug&&o(a)}function o(){window.console&&window.console.log&&window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function e(a,b,f){function k(n,m,q){if(!n&&m===true){n=d(q).data("cycle.opts");if(!n){o("options not found, can not resume");return false}if(q.cycleTimeout){clearTimeout(q.cycleTimeout);q.cycleTimeout=0}w(n.elements,n,1,!j.rev&&!j.backwards)}}if(a.cycleStop==undefined)a.cycleStop=0;if(b===undefined||b===null)b={};if(b.constructor==
String){switch(b){case "destroy":case "stop":var j=d(a).data("cycle.opts");if(!j)return false;a.cycleStop++;a.cycleTimeout&&clearTimeout(a.cycleTimeout);a.cycleTimeout=0;d(a).removeData("cycle.opts");b=="destroy"&&i(j);return false;case "toggle":a.cyclePause=a.cyclePause===1?0:1;k(a.cyclePause,f,a);return false;case "pause":a.cyclePause=1;return false;case "resume":a.cyclePause=0;k(false,f,a);return false;case "prev":case "next":j=d(a).data("cycle.opts");if(!j){o('options not found, "prev/next" ignored');
return false}d.fn.cycle[b](j);return false;default:b={fx:b}}return b}else if(b.constructor==Number){var c=b;b=d(a).data("cycle.opts");if(!b){o("options not found, can not advance slide");return false}if(c<0||c>=b.elements.length){o("invalid slide index: "+c);return false}b.nextSlide=c;if(a.cycleTimeout){clearTimeout(a.cycleTimeout);a.cycleTimeout=0}if(typeof f=="string")b.oneTimeFx=f;w(b.elements,b,1,c>=b.currSlide);return false}return b}function l(a,b){if(!d.support.opacity&&b.cleartype&&a.style.filter)try{a.style.removeAttribute("filter")}catch(f){}}
function i(a){a.next&&d(a.next).unbind(a.prevNextEvent);a.prev&&d(a.prev).unbind(a.prevNextEvent);if(a.pager||a.pagerAnchorBuilder)d.each(a.pagerAnchors||[],function(){this.unbind().remove()});a.pagerAnchors=null;a.destroy&&a.destroy(a)}function g(a,b,f,k,j){var c=d.extend({},d.fn.cycle.defaults,k||{},d.metadata?a.metadata():d.meta?a.data():{});if(c.autostop)c.countdown=c.autostopCount||f.length;var n=a[0];a.data("cycle.opts",c);c.$cont=a;c.stopCount=n.cycleStop;c.elements=f;c.before=c.before?[c.before]:
[];c.after=c.after?[c.after]:[];c.after.unshift(function(){c.busy=0});!d.support.opacity&&c.cleartype&&c.after.push(function(){l(this,c)});c.continuous&&c.after.push(function(){w(f,c,0,!c.rev&&!c.backwards)});r(c);!d.support.opacity&&c.cleartype&&!c.cleartypeNoBg&&B(b);a.css("position")=="static"&&a.css("position","relative");c.width&&a.width(c.width);c.height&&c.height!="auto"&&a.height(c.height);if(c.startingSlide)c.startingSlide=parseInt(c.startingSlide);else if(c.backwards)c.startingSlide=f.length-
1;if(c.random){c.randomMap=[];for(n=0;n<f.length;n++)c.randomMap.push(n);c.randomMap.sort(function(){return Math.random()-0.5});c.randomIndex=1;c.startingSlide=c.randomMap[1]}else if(c.startingSlide>=f.length)c.startingSlide=0;c.currSlide=c.startingSlide||0;var m=c.startingSlide;b.css({position:"absolute",top:0,left:0}).hide().each(function(u){u=c.backwards?m?u<=m?f.length+(u-m):m-u:f.length-u:m?u>=m?f.length-(u-m):m-u:f.length-u;d(this).css("z-index",u)});d(f[m]).css("opacity",1).show();l(f[m],c);
c.fit&&c.width&&b.width(c.width);c.fit&&c.height&&c.height!="auto"&&b.height(c.height);if(c.containerResize&&!a.innerHeight()){for(var q=n=0,y=0;y<f.length;y++){var z=d(f[y]),C=z[0],D=z.outerWidth(),E=z.outerHeight();D||(D=C.offsetWidth||C.width||z.attr("width"));E||(E=C.offsetHeight||C.height||z.attr("height"));n=D>n?D:n;q=E>q?E:q}n>0&&q>0&&a.css({width:n+"px",height:q+"px"})}c.pause&&a.hover(function(){this.cyclePause++},function(){this.cyclePause--});if(s(c)===false)return false;var F=false;k.requeueAttempts=
k.requeueAttempts||0;b.each(function(){var u=d(this);this.cycleH=c.fit&&c.height?c.height:u.height()||this.offsetHeight||this.height||u.attr("height")||0;this.cycleW=c.fit&&c.width?c.width:u.width()||this.offsetWidth||this.width||u.attr("width")||0;if(u.is("img")){u=d.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete;var G=d.browser.opera&&(this.cycleW==42&&this.cycleH==19||this.cycleW==37&&this.cycleH==17)&&!this.complete,H=this.cycleH==0&&this.cycleW==0&&!this.complete;if(d.browser.msie&&
this.cycleW==28&&this.cycleH==30&&!this.complete||u||G||H)if(j.s&&c.requeueOnImageNotLoaded&&++k.requeueAttempts<100){o(k.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){d(j.s,j.c).cycle(k)},c.requeueTimeout);F=true;return false}else o("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}return true});if(F)return false;c.cssBefore=c.cssBefore||{};c.animIn=c.animIn||{};c.animOut=c.animOut||{};b.not(":eq("+m+
")").css(c.cssBefore);c.cssFirst&&d(b[m]).css(c.cssFirst);if(c.timeout){c.timeout=parseInt(c.timeout);if(c.speed.constructor==String)c.speed=d.fx.speeds[c.speed]||parseInt(c.speed);c.sync||(c.speed/=2);for(n=c.fx=="shuffle"?500:250;c.timeout-c.speed<n;)c.timeout+=c.speed}if(c.easing)c.easeIn=c.easeOut=c.easing;if(!c.speedIn)c.speedIn=c.speed;if(!c.speedOut)c.speedOut=c.speed;c.slideCount=f.length;c.currSlide=c.lastSlide=m;if(c.random){if(++c.randomIndex==f.length)c.randomIndex=0;c.nextSlide=c.randomMap[c.randomIndex]}else c.nextSlide=
c.backwards?c.startingSlide==0?f.length-1:c.startingSlide-1:c.startingSlide>=f.length-1?0:c.startingSlide+1;if(!c.multiFx){n=d.fn.cycle.transitions[c.fx];if(d.isFunction(n))n(a,b,c);else if(c.fx!="custom"&&!c.multiFx){o("unknown transition: "+c.fx,"; slideshow terminating");return false}}a=b[m];c.before.length&&c.before[0].apply(a,[a,a,c,true]);c.after.length>1&&c.after[1].apply(a,[a,a,c,true]);c.next&&d(c.next).bind(c.prevNextEvent,function(){return x(c,c.rev?-1:1)});c.prev&&d(c.prev).bind(c.prevNextEvent,
function(){return x(c,c.rev?1:-1)});if(c.pager||c.pagerAnchorBuilder)A(f,c);t(c,f);return c}function r(a){a.original={before:[],after:[]};a.original.cssBefore=d.extend({},a.cssBefore);a.original.cssAfter=d.extend({},a.cssAfter);a.original.animIn=d.extend({},a.animIn);a.original.animOut=d.extend({},a.animOut);d.each(a.before,function(){a.original.before.push(this)});d.each(a.after,function(){a.original.after.push(this)})}function s(a){var b,f,k=d.fn.cycle.transitions;if(a.fx.indexOf(",")>0){a.multiFx=
true;a.fxs=a.fx.replace(/\s*/g,"").split(",");for(b=0;b<a.fxs.length;b++){var j=a.fxs[b];f=k[j];if(!f||!k.hasOwnProperty(j)||!d.isFunction(f)){o("discarding unknown transition: ",j);a.fxs.splice(b,1);b--}}if(!a.fxs.length){o("No valid transitions named; slideshow terminating.");return false}}else if(a.fx=="all"){a.multiFx=true;a.fxs=[];for(p in k){f=k[p];k.hasOwnProperty(p)&&d.isFunction(f)&&a.fxs.push(p)}}if(a.multiFx&&a.randomizeEffects){f=Math.floor(Math.random()*20)+30;for(b=0;b<f;b++)a.fxs.push(a.fxs.splice(Math.floor(Math.random()*
a.fxs.length),1)[0]);h("randomized fx sequence: ",a.fxs)}return true}function t(a,b){a.addSlide=function(f,k){var j=d(f),c=j[0];a.autostopCount||a.countdown++;b[k?"unshift":"push"](c);if(a.els)a.els[k?"unshift":"push"](c);a.slideCount=b.length;j.css("position","absolute");j[k?"prependTo":"appendTo"](a.$cont);if(k){a.currSlide++;a.nextSlide++}!d.support.opacity&&a.cleartype&&!a.cleartypeNoBg&&B(j);a.fit&&a.width&&j.width(a.width);a.fit&&a.height&&a.height!="auto"&&$slides.height(a.height);c.cycleH=
a.fit&&a.height?a.height:j.height();c.cycleW=a.fit&&a.width?a.width:j.width();j.css(a.cssBefore);if(a.pager||a.pagerAnchorBuilder)d.fn.cycle.createPagerAnchor(b.length-1,c,d(a.pager),b,a);d.isFunction(a.onAddSlide)?a.onAddSlide(j):j.hide()}}function w(a,b,f,k){if(f&&b.busy&&b.manualTrump){h("manualTrump in go(), stopping active transition");d(a).stop(true,true);b.busy=false}if(b.busy)h("transition active, ignoring new tx request");else{var j=b.$cont[0],c=a[b.currSlide],n=a[b.nextSlide];if(!(j.cycleStop!=
b.stopCount||j.cycleTimeout===0&&!f))if(!f&&!j.cyclePause&&!b.bounce&&(b.autostop&&--b.countdown<=0||b.nowrap&&!b.random&&b.nextSlide<b.currSlide))b.end&&b.end(b);else{var m=false;if((f||!j.cyclePause)&&b.nextSlide!=b.currSlide){m=true;var q=b.fx;c.cycleH=c.cycleH||d(c).height();c.cycleW=c.cycleW||d(c).width();n.cycleH=n.cycleH||d(n).height();n.cycleW=n.cycleW||d(n).width();if(b.multiFx){if(b.lastFx==undefined||++b.lastFx>=b.fxs.length)b.lastFx=0;q=b.fxs[b.lastFx];b.currFx=q}if(b.oneTimeFx){q=b.oneTimeFx;
b.oneTimeFx=null}d.fn.cycle.resetState(b,q);b.before.length&&d.each(b.before,function(y,z){j.cycleStop==b.stopCount&&z.apply(n,[c,n,b,k])});q=function(){d.each(b.after,function(y,z){j.cycleStop==b.stopCount&&z.apply(n,[c,n,b,k])})};h("tx firing; currSlide: "+b.currSlide+"; nextSlide: "+b.nextSlide);b.busy=1;if(b.fxFn)b.fxFn(c,n,b,q,k,f&&b.fastOnEvent);else d.isFunction(d.fn.cycle[b.fx])?d.fn.cycle[b.fx](c,n,b,q,k,f&&b.fastOnEvent):d.fn.cycle.custom(c,n,b,q,k,f&&b.fastOnEvent)}if(m||b.nextSlide==b.currSlide){b.lastSlide=
b.currSlide;if(b.random){b.currSlide=b.nextSlide;if(++b.randomIndex==a.length)b.randomIndex=0;b.nextSlide=b.randomMap[b.randomIndex];if(b.nextSlide==b.currSlide)b.nextSlide=b.currSlide==b.slideCount-1?0:b.currSlide+1}else if(b.backwards)if((f=b.nextSlide-1<0)&&b.bounce){b.backwards=!b.backwards;b.nextSlide=1;b.currSlide=0}else{b.nextSlide=f?a.length-1:b.nextSlide-1;b.currSlide=f?0:b.nextSlide+1}else if((f=b.nextSlide+1==a.length)&&b.bounce){b.backwards=!b.backwards;b.nextSlide=a.length-2;b.currSlide=
a.length-1}else{b.nextSlide=f?0:b.nextSlide+1;b.currSlide=f?a.length-1:b.nextSlide-1}}m&&b.pager&&b.updateActivePagerLink(b.pager,b.currSlide,b.activePagerClass);m=0;if(b.timeout&&!b.continuous)m=v(a[b.currSlide],a[b.nextSlide],b,k);else if(b.continuous&&j.cyclePause)m=10;if(m>0)j.cycleTimeout=setTimeout(function(){w(a,b,0,!b.rev&&!b.backwards)},m)}}}function v(a,b,f,k){if(f.timeoutFn){for(a=f.timeoutFn.call(a,a,b,f,k);a-f.speed<250;)a+=f.speed;h("calculated timeout: "+a+"; speed: "+f.speed);if(a!==
false)return a}return f.timeout}function x(a,b){var f=a.elements,k=a.$cont[0],j=k.cycleTimeout;if(j){clearTimeout(j);k.cycleTimeout=0}if(a.random&&b<0){a.randomIndex--;if(--a.randomIndex==-2)a.randomIndex=f.length-2;else if(a.randomIndex==-1)a.randomIndex=f.length-1;a.nextSlide=a.randomMap[a.randomIndex]}else if(a.random)a.nextSlide=a.randomMap[a.randomIndex];else{a.nextSlide=a.currSlide+b;if(a.nextSlide<0){if(a.nowrap)return false;a.nextSlide=f.length-1}else if(a.nextSlide>=f.length){if(a.nowrap)return false;
a.nextSlide=0}}k=a.onPrevNextEvent||a.prevNextClick;d.isFunction(k)&&k(b>0,a.nextSlide,f[a.nextSlide]);w(f,a,1,b>=0);return false}function A(a,b){var f=d(b.pager);d.each(a,function(k,j){d.fn.cycle.createPagerAnchor(k,j,f,a,b)});b.updateActivePagerLink(b.pager,b.startingSlide,b.activePagerClass)}function B(a){function b(k){k=parseInt(k).toString(16);return k.length<2?"0"+k:k}function f(k){for(;k&&k.nodeName.toLowerCase()!="html";k=k.parentNode){var j=d.css(k,"background-color");if(j.indexOf("rgb")>=
0){k=j.match(/\d+/g);return"#"+b(k[0])+b(k[1])+b(k[2])}if(j&&j!="transparent")return j}return"#ffffff"}h("applying clearType background-color hack");a.each(function(){d(this).css("background-color",f(this))})}if(d.support==undefined)d.support={opacity:!d.browser.msie};d.fn.cycle=function(a,b){var f={s:this.selector,c:this.context};if(this.length===0&&a!="stop"){if(!d.isReady&&f.s){o("DOM not ready, queuing slideshow");d(function(){d(f.s,f.c).cycle(a,b)});return this}o("terminating; zero elements found by selector"+
(d.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var k=e(this,a,b);if(k!==false){k.updateActivePagerLink=k.updateActivePagerLink||d.fn.cycle.updateActivePagerLink;this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cycleTimeout=this.cyclePause=0;var j=d(this),c=k.slideExpr?d(k.slideExpr,this):j.children(),n=c.get();if(n.length<2)o("terminating; too few slides: "+n.length);else{var m=g(j,c,n,k,f);if(m!==false)if(j=m.continuous?10:v(n[m.currSlide],n[m.nextSlide],m,!m.rev)){j+=
m.delay||0;if(j<10)j=10;h("first timeout: "+j);this.cycleTimeout=setTimeout(function(){w(n,m,0,!m.rev&&!k.backwards)},j)}}}})};d.fn.cycle.resetState=function(a,b){b=b||a.fx;a.before=[];a.after=[];a.cssBefore=d.extend({},a.original.cssBefore);a.cssAfter=d.extend({},a.original.cssAfter);a.animIn=d.extend({},a.original.animIn);a.animOut=d.extend({},a.original.animOut);a.fxFn=null;d.each(a.original.before,function(){a.before.push(this)});d.each(a.original.after,function(){a.after.push(this)});var f=d.fn.cycle.transitions[b];
d.isFunction(f)&&f(a.$cont,d(a.elements),a)};d.fn.cycle.updateActivePagerLink=function(a,b,f){d(a).each(function(){d(this).children().removeClass(f).eq(b).addClass(f)})};d.fn.cycle.next=function(a){x(a,a.rev?-1:1)};d.fn.cycle.prev=function(a){x(a,a.rev?1:-1)};d.fn.cycle.createPagerAnchor=function(a,b,f,k,j){if(d.isFunction(j.pagerAnchorBuilder)){b=j.pagerAnchorBuilder(a,b);h("pagerAnchorBuilder("+a+", el) returned: "+b)}else b='<a href="#">'+(a+1)+"</a>";if(b){var c=d(b);if(c.parents("body").length===
0){var n=[];if(f.length>1){f.each(function(){var m=c.clone(true);d(this).append(m);n.push(m[0])});c=d(n)}else c.appendTo(f)}j.pagerAnchors=j.pagerAnchors||[];j.pagerAnchors.push(c);c.bind(j.pagerEvent,function(m){m.preventDefault();j.nextSlide=a;m=j.$cont[0];var q=m.cycleTimeout;if(q){clearTimeout(q);m.cycleTimeout=0}m=j.onPagerEvent||j.pagerClick;d.isFunction(m)&&m(j.nextSlide,k[j.nextSlide]);w(k,j,1,j.currSlide<a)});!/^click/.test(j.pagerEvent)&&!j.allowPagerClickBubble&&c.bind("click.cycle",function(){return false});
j.pauseOnPagerHover&&c.hover(function(){j.$cont[0].cyclePause++},function(){j.$cont[0].cyclePause--})}};d.fn.cycle.hopsFromLast=function(a,b){var f=a.lastSlide,k=a.currSlide;return b?k>f?k-f:a.slideCount-f:k<f?f-k:f+a.slideCount-k};d.fn.cycle.commonReset=function(a,b,f,k,j,c){d(f.elements).not(a).hide();f.cssBefore.opacity=1;f.cssBefore.display="block";if(k!==false&&b.cycleW>0)f.cssBefore.width=b.cycleW;if(j!==false&&b.cycleH>0)f.cssBefore.height=b.cycleH;f.cssAfter=f.cssAfter||{};f.cssAfter.display=
"none";d(a).css("zIndex",f.slideCount+(c===true?1:0));d(b).css("zIndex",f.slideCount+(c===true?0:1))};d.fn.cycle.custom=function(a,b,f,k,j,c){var n=d(a),m=d(b),q=f.speedIn;a=f.speedOut;var y=f.easeIn;b=f.easeOut;m.css(f.cssBefore);if(c){q=typeof c=="number"?a=c:a=1;y=b=null}n.animate(f.animOut,a,b,function(){f.cssAfter&&n.css(f.cssAfter);f.sync||m.animate(f.animIn,q,y,k)});f.sync&&m.animate(f.animIn,q,y,k)};d.fn.cycle.transitions={fade:function(a,b,f){b.not(":eq("+f.currSlide+")").css("opacity",0);
f.before.push(function(k,j,c){d.fn.cycle.commonReset(k,j,c);c.cssBefore.opacity=0});f.animIn={opacity:1};f.animOut={opacity:0};f.cssBefore={top:0,left:0}}};d.fn.cycle.ver=function(){return"2.88"};d.fn.cycle.defaults={fx:"fade",timeout:4E3,timeoutFn:null,continuous:0,speed:1E3,speedIn:null,speedOut:null,next:null,prev:null,onPrevNextEvent:null,prevNextEvent:"click.cycle",pager:null,onPagerEvent:null,pagerEvent:"click.cycle",allowPagerClickBubble:false,pagerAnchorBuilder:null,before:null,after:null,
end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!d.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null,backwards:false}})(jQuery);
(function(d){d.fn.cycle.transitions.none=function(h,o,e){e.fxFn=function(l,i,g,r){d(i).show();d(l).hide();r()}};d.fn.cycle.transitions.scrollUp=function(h,o,e){h.css("overflow","hidden");e.before.push(d.fn.cycle.commonReset);h=h.height();e.cssBefore={top:h,left:0};e.cssFirst={top:0};e.animIn={top:0};e.animOut={top:-h}};d.fn.cycle.transitions.scrollDown=function(h,o,e){h.css("overflow","hidden");e.before.push(d.fn.cycle.commonReset);h=h.height();e.cssFirst={top:0};e.cssBefore={top:-h,left:0};e.animIn=
{top:0};e.animOut={top:h}};d.fn.cycle.transitions.scrollLeft=function(h,o,e){h.css("overflow","hidden");e.before.push(d.fn.cycle.commonReset);h=h.width();e.cssFirst={left:0};e.cssBefore={left:h,top:0};e.animIn={left:0};e.animOut={left:0-h}};d.fn.cycle.transitions.scrollRight=function(h,o,e){h.css("overflow","hidden");e.before.push(d.fn.cycle.commonReset);h=h.width();e.cssFirst={left:0};e.cssBefore={left:-h,top:0};e.animIn={left:0};e.animOut={left:h}};d.fn.cycle.transitions.scrollHorz=function(h,o,
e){h.css("overflow","hidden").width();e.before.push(function(l,i,g,r){d.fn.cycle.commonReset(l,i,g);g.cssBefore.left=r?i.cycleW-1:1-i.cycleW;g.animOut.left=r?-l.cycleW:l.cycleW});e.cssFirst={left:0};e.cssBefore={top:0};e.animIn={left:0};e.animOut={top:0}};d.fn.cycle.transitions.scrollVert=function(h,o,e){h.css("overflow","hidden");e.before.push(function(l,i,g,r){d.fn.cycle.commonReset(l,i,g);g.cssBefore.top=r?1-i.cycleH:i.cycleH-1;g.animOut.top=r?l.cycleH:-l.cycleH});e.cssFirst={top:0};e.cssBefore=
{left:0};e.animIn={top:0};e.animOut={left:0}};d.fn.cycle.transitions.slideX=function(h,o,e){e.before.push(function(l,i,g){d(g.elements).not(l).hide();d.fn.cycle.commonReset(l,i,g,false,true);g.animIn.width=i.cycleW});e.cssBefore={left:0,top:0,width:0};e.animIn={width:"show"};e.animOut={width:0}};d.fn.cycle.transitions.slideY=function(h,o,e){e.before.push(function(l,i,g){d(g.elements).not(l).hide();d.fn.cycle.commonReset(l,i,g,true,false);g.animIn.height=i.cycleH});e.cssBefore={left:0,top:0,height:0};
e.animIn={height:"show"};e.animOut={height:0}};d.fn.cycle.transitions.shuffle=function(h,o,e){h=h.css("overflow","visible").width();o.css({left:0,top:0});e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g,true,true,true)});if(!e.speedAdjusted){e.speed/=2;e.speedAdjusted=true}e.random=0;e.shuffle=e.shuffle||{left:-h,top:15};e.els=[];for(h=0;h<o.length;h++)e.els.push(o[h]);for(h=0;h<e.currSlide;h++)e.els.push(e.els.shift());e.fxFn=function(l,i,g,r,s){var t=s?d(l):d(i);d(i).css(g.cssBefore);
var w=g.slideCount;t.animate(g.shuffle,g.speedIn,g.easeIn,function(){for(var v=d.fn.cycle.hopsFromLast(g,s),x=0;x<v;x++)s?g.els.push(g.els.shift()):g.els.unshift(g.els.pop());if(s){v=0;for(x=g.els.length;v<x;v++)d(g.els[v]).css("z-index",x-v+w)}else{v=d(l).css("z-index");t.css("z-index",parseInt(v)+1+w)}t.animate({left:0,top:0},g.speedOut,g.easeOut,function(){d(s?this:l).hide();r&&r()})})};e.cssBefore={display:"block",opacity:1,top:0,left:0}};d.fn.cycle.transitions.turnUp=function(h,o,e){e.before.push(function(l,
i,g){d.fn.cycle.commonReset(l,i,g,true,false);g.cssBefore.top=i.cycleH;g.animIn.height=i.cycleH});e.cssFirst={top:0};e.cssBefore={left:0,height:0};e.animIn={top:0};e.animOut={height:0}};d.fn.cycle.transitions.turnDown=function(h,o,e){e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g,true,false);g.animIn.height=i.cycleH;g.animOut.top=l.cycleH});e.cssFirst={top:0};e.cssBefore={left:0,top:0,height:0};e.animOut={height:0}};d.fn.cycle.transitions.turnLeft=function(h,o,e){e.before.push(function(l,
i,g){d.fn.cycle.commonReset(l,i,g,false,true);g.cssBefore.left=i.cycleW;g.animIn.width=i.cycleW});e.cssBefore={top:0,width:0};e.animIn={left:0};e.animOut={width:0}};d.fn.cycle.transitions.turnRight=function(h,o,e){e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g,false,true);g.animIn.width=i.cycleW;g.animOut.left=l.cycleW});e.cssBefore={top:0,left:0,width:0};e.animIn={left:0};e.animOut={width:0}};d.fn.cycle.transitions.zoom=function(h,o,e){e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,
i,g,false,false,true);g.cssBefore.top=i.cycleH/2;g.cssBefore.left=i.cycleW/2;g.animIn={top:0,left:0,width:i.cycleW,height:i.cycleH};g.animOut={width:0,height:0,top:l.cycleH/2,left:l.cycleW/2}});e.cssFirst={top:0,left:0};e.cssBefore={width:0,height:0}};d.fn.cycle.transitions.fadeZoom=function(h,o,e){e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g,false,false);g.cssBefore.left=i.cycleW/2;g.cssBefore.top=i.cycleH/2;g.animIn={top:0,left:0,width:i.cycleW,height:i.cycleH}});e.cssBefore={width:0,
height:0};e.animOut={opacity:0}};d.fn.cycle.transitions.blindX=function(h,o,e){h=h.css("overflow","hidden").width();e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g);g.animIn.width=i.cycleW;g.animOut.left=l.cycleW});e.cssBefore={left:h,top:0};e.animIn={left:0};e.animOut={left:h}};d.fn.cycle.transitions.blindY=function(h,o,e){h=h.css("overflow","hidden").height();e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g);g.animIn.height=i.cycleH;g.animOut.top=l.cycleH});e.cssBefore={top:h,
left:0};e.animIn={top:0};e.animOut={top:h}};d.fn.cycle.transitions.blindZ=function(h,o,e){o=h.css("overflow","hidden").height();h=h.width();e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g);g.animIn.height=i.cycleH;g.animOut.top=l.cycleH});e.cssBefore={top:o,left:h};e.animIn={top:0,left:0};e.animOut={top:o,left:h}};d.fn.cycle.transitions.growX=function(h,o,e){e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g,false,true);g.cssBefore.left=this.cycleW/2;g.animIn={left:0,width:this.cycleW};
g.animOut={left:0}});e.cssBefore={width:0,top:0}};d.fn.cycle.transitions.growY=function(h,o,e){e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g,true,false);g.cssBefore.top=this.cycleH/2;g.animIn={top:0,height:this.cycleH};g.animOut={top:0}});e.cssBefore={height:0,left:0}};d.fn.cycle.transitions.curtainX=function(h,o,e){e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g,false,true,true);g.cssBefore.left=i.cycleW/2;g.animIn={left:0,width:this.cycleW};g.animOut={left:l.cycleW/2,width:0}});
e.cssBefore={top:0,width:0}};d.fn.cycle.transitions.curtainY=function(h,o,e){e.before.push(function(l,i,g){d.fn.cycle.commonReset(l,i,g,true,false,true);g.cssBefore.top=i.cycleH/2;g.animIn={top:0,height:i.cycleH};g.animOut={top:l.cycleH/2,height:0}});e.cssBefore={left:0,height:0}};d.fn.cycle.transitions.cover=function(h,o,e){var l=e.direction||"left",i=h.css("overflow","hidden").width(),g=h.height();e.before.push(function(r,s,t){d.fn.cycle.commonReset(r,s,t);if(l=="right")t.cssBefore.left=-i;else if(l==
"up")t.cssBefore.top=g;else if(l=="down")t.cssBefore.top=-g;else t.cssBefore.left=i});e.animIn={left:0,top:0};e.animOut={opacity:1};e.cssBefore={top:0,left:0}};d.fn.cycle.transitions.uncover=function(h,o,e){var l=e.direction||"left",i=h.css("overflow","hidden").width(),g=h.height();e.before.push(function(r,s,t){d.fn.cycle.commonReset(r,s,t,true,true,true);if(l=="right")t.animOut.left=i;else if(l=="up")t.animOut.top=-g;else if(l=="down")t.animOut.top=g;else t.animOut.left=-i});e.animIn={left:0,top:0};
e.animOut={opacity:1};e.cssBefore={top:0,left:0}};d.fn.cycle.transitions.toss=function(h,o,e){var l=h.css("overflow","visible").width(),i=h.height();e.before.push(function(g,r,s){d.fn.cycle.commonReset(g,r,s,true,true,true);if(!s.animOut.left&&!s.animOut.top)s.animOut={left:l*2,top:-i/2,opacity:0};else s.animOut.opacity=0});e.cssBefore={left:0,top:0};e.animIn={left:0}};d.fn.cycle.transitions.wipe=function(h,o,e){var l=h.css("overflow","hidden").width(),i=h.height();e.cssBefore=e.cssBefore||{};var g;
if(e.clip)if(/l2r/.test(e.clip))g="rect(0px 0px "+i+"px 0px)";else if(/r2l/.test(e.clip))g="rect(0px "+l+"px "+i+"px "+l+"px)";else if(/t2b/.test(e.clip))g="rect(0px "+l+"px 0px 0px)";else if(/b2t/.test(e.clip))g="rect("+i+"px "+l+"px "+i+"px 0px)";else if(/zoom/.test(e.clip)){h=parseInt(i/2);o=parseInt(l/2);g="rect("+h+"px "+o+"px "+h+"px "+o+"px)"}e.cssBefore.clip=e.cssBefore.clip||g||"rect(0px 0px 0px 0px)";h=e.cssBefore.clip.match(/(\d+)/g);var r=parseInt(h[0]),s=parseInt(h[1]),t=parseInt(h[2]),
w=parseInt(h[3]);e.before.push(function(v,x,A){if(v!=x){var B=d(v),a=d(x);d.fn.cycle.commonReset(v,x,A,true,true,false);A.cssAfter.display="block";var b=1,f=parseInt(A.speedIn/13)-1;(function k(){var j=r?r-parseInt(b*(r/f)):0,c=w?w-parseInt(b*(w/f)):0,n=t<i?t+parseInt(b*((i-t)/f||1)):i,m=s<l?s+parseInt(b*((l-s)/f||1)):l;a.css({clip:"rect("+j+"px "+m+"px "+n+"px "+c+"px)"});b++<=f?setTimeout(k,13):B.css("display","none")})()}});e.cssBefore={display:"block",opacity:1,top:0,left:0};e.animIn={left:0};
e.animOut={left:0}}})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment