1/** 2 * header slider 3 */ 4 5var dkHeaderslider = function() { 6 var that = this; 7 this.wrap = document.getElementById("headerslider_wrap"); 8 this.html = that.wrap.innerHTML; 9 this.container = '.headerslider_elements'; 10 this.viewport = ''; 11 this.slider = ''; 12 13 this.setViewport = function() { 14 if (window.innerWidth < 1024) { 15 that.viewport = 'mobile'; 16 } else { 17 that.viewport = 'desktop'; 18 } 19 } 20 21 this.initSlider = function() { 22 if (window.innerWidth < 1024) { 23 that.slider = tns({ 24 container: that.container, 25 items: 1, 26 nav: true, 27 swipeAngle: false, 28 navPosition: 'bottom', 29 controls: false, 30 autoplay: true, 31 autoplayTimeout: 8000, 32 autoplayHoverPause: true, 33 speed: 300, 34 autoplayButtonOutput: false, 35 autoplayText: false, 36 controlsText: ['<i class="icon icon-arrow-up"></i>', '<i class="icon icon-arrow-down"></i>'], 37 onInit: function(info) { 38 lazyLoadInstance.update(); 39 //headerslider.refresh(); 40 } 41 }); 42 } else { 43 that.slider = tns({ 44 container: that.container, 45 items: 1, 46 nav: true, 47 axis: 'vertical', 48 swipeAngle: false, 49 navPosition: 'bottom', 50 controls: true, 51 autoplay: true, 52 autoplayTimeout: 8000, 53 autoplayHoverPause: true, 54 speed: 300, 55 autoplayButtonOutput: false, 56 autoplayText: false, 57 controlsText: ['<i class="icon icon-arrow-up"></i>', '<i class="icon icon-arrow-down"></i>'], 58 onInit: function(info) { 59 lazyLoadInstance.update(); 60 } 61 }); 62 } 63 } 64 65 this.onResize = function() { 66 if (that.viewport === 'mobile') { 67 if (window.innerWidth >= 1024) { 68 that.slider.destroy(); 69 that.wrap.innerHTML = that.html; 70 that.setViewport(); 71 that.initSlider(); 72 } 73 } 74 if (that.viewport === 'desktop') { 75 if (window.innerWidth < 1024) { 76 that.slider.destroy(); 77 that.wrap.innerHTML = that.html; 78 that.setViewport(); 79 that.initSlider(); 80 } 81 } 82 } 83 84 this.init = function() { 85 that.setViewport(); 86 that.initSlider(); 87 88 window.addEventListener('resize', that.onResize); 89 } 90 this.init(); 91 92} 93 94initHeaderslider = function() { 95 headerslider = new dkHeaderslider(); 96} 97 98document.addEventListener('DOMContentLoaded', function() { 99 initHeaderslider(); 100});
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.