1/* 2 * Copyright 2014, Theia Post Slider, Liviu Cristian Mirea Ghiban. 3 */ 4var tps = tps || {}; 5tps.transitions = tps.transitions || {}; 6tps.transitions.slide = function(me, previousIndex, newIndex) { 7 var $ = jQuery; 8 9 // Init 10 var width = me.destE.innerWidth(), 11 diff = newIndex - previousIndex, 12 direction = diff > 0 ? 1 : -1; 13 14 // Remove previous slide 15 var previousSlide = previousIndex !== null ? $(me.slides[previousIndex].content) : null; 16 if (previousSlide) { 17 me.destE.css('height', previousSlide.innerHeight()); 18 me.attachAnimation(); 19 previousSlide 20 .css('width', width) 21 .css('position', 'absolute') 22 .css('left', 0) 23 .animate({ 24 left: -direction * width 25 }, me.options.transitionSpeed, function(me) { 26 return function() { 27 $(this) 28 .detach() 29 .css('position', '') 30 .css('left', ''); 31 me.detachAnimation(); 32 } 33 }(me)); 34 } 35 36 var slide = me.slides[newIndex].content; 37 38 if (previousSlide == null) { 39 // Don't animate the first shown slide 40 me.destE.append(slide); 41 } 42 else { 43 slide.css('width', width); 44 slide.css('visibility', 'hidden'); 45 me.destE.append(slide); 46 47 // Call event handlers 48 me.onNewSlide(); 49 50 // Animate the height 51 me.attachAnimation(); 52 me.destE.animate({ 53 'height': slide.innerHeight() 54 }, me.options.transitionSpeed, function(me) { 55 return function() { 56 $(this) 57 .css('position', ''); 58 me.detachAnimation(); 59 } 60 }(me)); 61 62 // Animate the new slide 63 me.attachAnimation(); 64 slide 65 .css('left', direction * width) 66 .css('position', 'absolute') 67 .css('visibility', 'visible') 68 .animate({ 69 left: '0' 70 }, me.options.transitionSpeed, function(me) { 71 return function() { 72 $(this) 73 .css('position', '') 74 .css('width', ''); 75 me.destE.css('height', ''); 76 me.detachAnimation(); 77 } 78 }(me)); 79 } 80}
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.