1/*! shuffle transition plugin for Cycle2; version: 20140128 */ 2(function($) { 3"use strict"; 4 5$.fn.cycle.transitions.shuffle = { 6 7 transition: function( opts, currEl, nextEl, fwd, callback ) { 8 $( nextEl ).css({ 9 display: 'block', 10 visibility: 'visible' 11 }); 12 var width = opts.container.css( 'overflow', 'visible' ).width(); 13 var speed = opts.speed / 2; // shuffle has 2 transitions 14 var element = fwd ? currEl : nextEl; 15 16 opts = opts.API.getSlideOpts( fwd ? opts.currSlide : opts.nextSlide ); 17 var props1 = { left:-width, top:15 }; 18 var props2 = opts.slideCss || { left:0, top:0 }; 19 20 if ( opts.shuffleLeft !== undefined ) { 21 props1.left = props1.left + parseInt(opts.shuffleLeft, 10) || 0; 22 } 23 else if ( opts.shuffleRight !== undefined ) { 24 props1.left = width + parseInt(opts.shuffleRight, 10) || 0; 25 } 26 if ( opts.shuffleTop ) { 27 props1.top = opts.shuffleTop; 28 } 29 30 // transition slide in 3 steps: move, re-zindex, move 31 $( element ) 32 .animate( props1, speed, opts.easeIn || opts.easing ) 33 .queue( 'fx', $.proxy(reIndex, this)) 34 .animate( props2, speed, opts.easeOut || opts.easing, callback ); 35 36 function reIndex(nextFn) { 37 /*jshint validthis:true */ 38 this.stack(opts, currEl, nextEl, fwd); 39 nextFn(); 40 } 41 }, 42 43 stack: function( opts, currEl, nextEl, fwd ) { 44 var i, z; 45 46 if (fwd) { 47 opts.API.stackSlides( nextEl, currEl, fwd ); 48 // force curr slide to bottom of the stack 49 $(currEl).css( 'zIndex', 1 ); 50 } 51 else { 52 z = 1; 53 for (i = opts.nextSlide - 1; i >= 0; i--) { 54 $(opts.slides[i]).css('zIndex', z++); 55 } 56 for (i = opts.slideCount - 1; i > opts.nextSlide; i--) { 57 $(opts.slides[i]).css('zIndex', z++); 58 } 59 $(nextEl).css( 'zIndex', opts.maxZ ); 60 $(currEl).css( 'zIndex', opts.maxZ - 1 ); 61 } 62 } 63}; 64 65})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.