1 2// Cycle plugin config 3jQuery(document).ready(function($){ 4 var c3TransitionType = "scrollRight"; 5 var c3Autostop = 0; 6 var c3Speed = 500; 7 var c3Timeout = 20000; 8 var c3Sync = 0; 9 10 // Cover the scenario of having only one slide 11 if ( $("#slider > li").size() == 1 ) { 12 if ( c3Autostop == 1 ) { 13 // sliding image 14 $('#slider').find('.sliding-image').css({'display':'block'}).delay(50).animate({'left':'10px', 'opacity':1}, 250, 'easeOutQuad'); 15 // sliding text 16 $('#slider').find('.sliding-text').css({'display':'block'}).delay(250).animate({'right':'10px', 'opacity':1}, 350, 'easeOutQuad'); 17 } else { 18 // Clone the first slide (only if there's one slide) to be able to initiate the transision effects 19 $('#slider li:eq(0)').clone().insertAfter('#slider li:eq(0)'); 20 } 21 } 22 23 /* homepage slider params */ 24 $('#slider').cycle({ 25 fx: c3TransitionType, 26 easing: 'easeOutQuad', 27 autostop: c3Autostop, 28 before: onBefore, 29 after: onAfter, 30 speed: c3Speed, 31 timeout: c3Timeout, 32 sync: c3Sync, 33 randomizeEffects: 0, 34 prev: '#slider-prev', 35 next: '#slider-next', 36 pager: '#nav' 37 }); 38 39 function onBefore(curr, next, opts, fwd) { 40 // sliding image 41 $(next).find('.sliding-image').css({'display':'none', 'left':'-940px'}); 42 // sliding text 43 $(next).find('.sliding-text').css({'display':'none', 'right':'-940px'}); 44 } 45 function onAfter(curr, next, opts, fwd) { 46 // sliding image 47 $(this).find('.sliding-image').css({'display':'block'}).delay(50).animate({'left':'10px', 'opacity':1}, 250, 'easeOutQuad'); 48 // sliding text 49 $(this).find('.sliding-text').css({'display':'block'}).delay(250).animate({'right':'10px', 'opacity':1}, 350, 'easeOutQuad'); 50 } 51 52 $('#pauseButton').click(function() { 53 $('#slider').cycle('pause'); 54 return false; 55 }); 56 57 $('#resumeButton').click(function() { 58 $('#slider').cycle('resume', true); 59 return false; 60 }); 61 62 63});
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.