1function customCarousel() { 2 var nbr_slides = $('#lp-main-carousel .slide').length; 3 var slideWidth = $('#lp-main-carousel .slide').width(); 4 var slides = $('#lp-main-carousel .slide'); 5 var slideIndex = 0; 6 var wrapper = $('#lp-main-carousel .wrapper'); 7 var xs_max = 767; 8 var carousel = $("#lp-main-carousel"); 9 var carousel_width = $(carousel).width(); 10 $('#lp-main-carousel .lp-carousel-control-prev').click(function(e) { 11 slide("PREV"); 12 e.preventDefault(); 13 }); 14 $('#lp-main-carousel .lp-carousel-control-next').click(function(e) { 15 slide("NEXT"); 16 e.preventDefault(); 17 }); 18 19 carousel.onSwipe(function(results){ 20 if(results.right == true) { 21 slide("PREV"); 22 23 } 24 if(results.left == true) { 25 slide("NEXT"); 26 27 } 28 }); 29 if (carousel_width > xs_max) { 30 // Let the css take over. 31 $(slides).css('width', ''); 32 } else { 33 $(slides).css('width', (carousel_width / 1.2 ) + 'px'); 34 slideWidth = $('#lp-main-carousel .slide').width(); 35 offset = 0; 36 } 37 function slide(direction) { 38 if (!nbr_slides) { 39 return; 40 } 41 42 if (direction == "PREV") { 43 if (slideIndex == 0) { 44 return; 45 } 46 slideIndex -= 1; 47 $(wrapper).css('margin-left', "+=" + slideWidth + "px"); 48 } 49 if (direction == "NEXT") { 50 if (slideIndex == nbr_slides -1) { 51 return; 52 } 53 slideIndex += 1; 54 $(wrapper).css('margin-left', "-=" + slideWidth + "px"); 55 } 56 } 57} 58$(document).ready(function() { 59 customCarousel(); 60 $(window).resize(customCarousel); 61 62});
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.