1/** 2 * Created by nicolas on 26/02/21. 3 */ 4 5jQuery(function($) { 6 7 $(document).ready(function(){ 8 sectionSliderInitialize(); 9 }); 10 11}); 12 13function sectionSliderInitialize() { 14 jQuery('.block-slider').each(function(){ 15 var nbItem = jQuery(this).find('.slider').data("nbitem"); 16 var margin = jQuery(this).find('.slider').data("margin"); 17 var current = jQuery(this); 18 var optionsGalery = { 19 item:nbItem, 20 controls:false, 21 loop:false, 22 auto:false, 23 pager:false, 24 pauseOnHover: true, 25 slideMove:1, 26 slideMargin: (typeof margin == "number") ? margin : 15, 27 easing: 'ease-in',//'cubic-bezier(0.25, 0, 0.25, 1)', 28 speed:300, 29 pause:5000, 30 adaptiveHeight:false, 31 onSliderLoad: function() { 32 current.find('.plug-ls').removeClass('cS-hidden'); 33 34 current.find('.link').on('click', function(){ 35 if ( !islockEl(jQuery(this), 350)) { 36 obj.goToSlide(parseInt(jQuery(this).attr('data-number')));//jQuery(this).attr('data-number')); 37 } 38 return false; 39 }) 40 41 current.find('.lSAction > .lSPrev').click(function () { 42 if ( !islockEl(jQuery(this), 350)) { 43 obj.goToPrevSlide(); 44 } 45 }); 46 current.find('.lSAction > .lSNext').click(function () { 47 if ( !islockEl(jQuery(this), 350)) { 48 obj.goToNextSlide(); 49 } 50 }); 51 }, 52 onAfterSlide:function(){ 53 checkLimitSlider(obj, current); 54 }, 55 onBeforeSlide: function (el) { 56 current.find('.current_number').text(el.getCurrentSlideCount()); 57 } 58 } 59 60 // responsive 61 var responsive = jQuery(this).find('.slider').data("responsive"); 62 optionsGalery["responsive"] = getResponsive(responsive); 63 var obj = current.find('.plug-ls').lightSlider(optionsGalery); 64 checkLimitSlider(obj, current); 65 }); 66} 67 68function getResponsive(responsive){ 69 if (responsive) { 70 var breakpoint = responsive.split(","); 71 var max = parseInt(breakpoint.length - 1); 72 optionsGalery = []; 73 for (i = max; i > -1; i--) { 74 var tSplit = breakpoint[i].trim().split(" "); 75 optionsGalery.push({ breakpoint:tSplit[0], settings: { item:tSplit[1] }}); 76 } 77 } 78 return optionsGalery; 79} 80 81 82function popinSlider(currentSlide){ 83 var current = jQuery('.popin-box'); 84 var optionsSlider = { 85 item:1, 86 controls:false, 87 loop:true, 88 auto:true, 89 pager:false, 90 pauseOnHover: true, 91 slideMove:1, 92 slideMargin:0, 93 easing: 'ease-in',//'cubic-bezier(0.25, 0, 0.25, 1)', 94 speed:300, 95 pause:5000, 96 adaptiveHeight:true, 97 onSliderLoad: function() { 98 obj.goToSlide(currentSlide); 99 current.find('.plug-ls').removeClass('cS-hidden'); 100 101 current.find('.lSAction > .lSPrev').click(function () { 102 if ( !islockEl(jQuery(this), 350)) { 103 obj.goToPrevSlide(); 104 } 105 }); 106 current.find('.lSAction > .lSNext').click(function () { 107 if ( !islockEl(jQuery(this), 350)) { 108 obj.goToNextSlide(); 109 } 110 }); 111 }, 112 onAfterSlide:function(){ 113 checkLimitSlider(obj, current); 114 } 115 }; 116 var obj = current.find('.plug-ls').lightSlider(optionsSlider); 117 checkLimitSlider(obj, current); 118} 119 120function checkLimitSlider(obj, current){ 121 var nbItem = current.find('.slider').data("nbitem") - 1; 122 var responsive = current.find('.slider').data("responsive"); 123 var breakpoint = responsive.split(","); 124 var max = parseInt(breakpoint.length - 1); 125 for (i = 0; i < max; i++) { 126 var tSplit = breakpoint[i].trim().split(" "); 127 if (jQuery(window).width() <= tSplit[0]) { 128 nbItem = tSplit[1] -1; 129 break; 130 } 131 } 132 133 if (current.find('.item').length < 1){ 134 current.find('.lSAction > .lSNext').hide(); 135 current.find('.lSAction > .lSPrev').hide(); 136 } else { 137 if (obj.getCurrentSlideCount() === 1){ 138 current.find('.lSAction > .lSPrev').hide(); 139 } else { 140 current.find('.lSAction > .lSPrev').show(); 141 } 142 if (obj.getCurrentSlideCount()+nbItem < obj.getTotalSlideCount()) { 143 current.find('.lSAction > .lSNext').show(); 144 } else { 145 current.find('.lSAction > .lSNext').hide(); 146 } 147 } 148}
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.