1(function($) { 2 $(function() { 3 var jcarousel = $('.jcarousel4').jcarousel({ 4 5 6 }); 7 var total_items = $('.jcarousel4').find('li').length; 8 9 10 jcarousel 11 .on('jcarousel:reload jcarousel:create', function () { 12 13 14 var carousel = $(this), 15 width = carousel.innerWidth(); 16 17 18 19 if (width >= 700) { 20 perpage = 5; 21 width = width / perpage - 10; 22 23 24 } else if (width >= 540) { 25 perpage = 3; 26 width = width / perpage - 10; 27 } else { 28 perpage = 1; 29 width = width / perpage; 30 31 } 32 33 34 if(total_items < perpage) $('.jcarousel4 ul').addClass('mene'); else $('.jcarousel4 ul').removeClass('mene'); 35 36 37 carousel.jcarousel('items').css('width', Math.ceil(width) + 'px'); 38 39 40 41 42 }) 43 .jcarousel({ 44 45 }); 46 47 48 49 $(".jcarousel4").swipe({ 50 swipeLeft: function (event, direction, distance, duration, fingerCount) { 51 $('.jcarousel4-control-next').trigger('click'); 52 }, 53 swipeRight: function (event, direction, distance, duration, fingerCount) { 54 $('.jcarousel4-control-prev').trigger('click'); 55 56 }, 57 //Default is 75px+ set to 0 for demo so any distance triggers swipe 58 threshold: 90, 59 maxTimeThreshold:500, 60 triggerOnTouchEnd:false, 61 triggerOnTouchLeave:true, 62 63 }); 64 65 $('.jcarousel4-control-prev') 66 .jcarouselControl({ 67 target: '-=1' 68 }); 69 70 $('.jcarousel4-control-next') 71 .jcarouselControl({ 72 target: '+=1' 73 }); 74 75 76 77 78 }); 79 })(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.