1$ = jQuery; 2 3let slider = new Array(); 4$(document).ready(function () { 5 $('.slider-wrapper').each(function() { 6 let sliderWrapper = $(this); 7 8 if (sliderWrapper.hasClass('fixedheight')) { 9 let sliderHeight = $(this).attr('fixedheight'); 10 sliderWrapper.height(sliderHeight); 11 } 12 13 let autoPlay = false; 14 let slideTime = 7; 15 if (sliderWrapper.hasClass('autoslide')) { 16 autoPlay = true; 17 slideTime = $(this).attr('slidetime'); 18 slideTime *= 1000; 19 } 20 21 let hasTabs = false; 22 if (sliderWrapper.attr('tabs') === "true") { 23 hasTabs = true; 24 } 25 26 let sliderCounter = $(this).parents('.page-element').data('elementnumber'); 27 28 let newSlider = tns({ 29 container: '.page-element-'+sliderCounter+' .tns-slider-replace', 30 items: 1, 31 slideBy: 'page', 32 autoplay: autoPlay, 33 autoplayTimeout: slideTime, 34 mouseDrag: true, 35 speed: 300, 36 autoHeight: false, 37 controlsText: ['<i class="fal fa-chevron-left"></i>', '<i class="fal fa-chevron-right"></i>'], 38 lazyload: false, 39 lazyloadSelector: 'img', 40 onInit: function() { 41 startTabProgress(); 42 removeCalcHeight(sliderWrapper); 43 } 44 }); 45 newSlider.events.on('transitionStart', startTabProgress); 46 slider.push(newSlider); 47 48 /** 49 * Start the tab progress animation for the current active tab 50 * 51 * @return void 52 */ 53 function startTabProgress() { 54 sliderWrapper.find('.tns-nav button .currentProgress').stop(); 55 sliderWrapper.find('.tns-nav button .currentProgress').width(0); 56 sliderWrapper.find('.tns-nav-active .currentProgress').animate({ 57 width: '100%' 58 }, slideTime); 59 } 60 }); 61}); 62 63/** 64 * 65 * Remove the height calculation of the slider after the slider is initialized 66 * This is necessary to prevent the slider from jumping 67 * 68 * @param {*} sliderWrapper The wrapper of the slider 69 * 70 * @return void 71 */ 72function removeCalcHeight(sliderWrapper) { 73 setTimeout(function () { 74 //clamp(); 75 $(sliderWrapper).animate({ 76 opacity: 1, 77 }, 150); 78 }, 300); 79}
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.