1(function($) { 2 var getBrowserWidth = function() { 3 if (window.innerWidth < 768) { 4 $(init); 5 6 function init() { 7 $('.main-mobile-slider').slick({ 8 dots: false, 9 infinite: true, 10 lazyLoad: 'ondemand', 11 autoplay: true, 12 autoplaySpeed: 8000, 13 accessibility: false, 14 responsive: [{ 15 breakpoint: 768, 16 settings: { 17 arrows: true, 18 dots: false, 19 lazyLoad: 'ondemand', 20 slidesToShow: 1 21 } 22 }, 23 { 24 breakpoint: 480, 25 settings: { 26 arrows: true, 27 dots: false, 28 lazyLoad: 'ondemand', 29 slidesToShow: 1 30 } 31 } 32 ] 33 }); 34 } 35 } else { 36 $(init); 37 38 function init() { 39 $('.main-desktop-slider').slick({ 40 dots: false, 41 infinite: true, 42 lazyLoad: 'ondemand', 43 autoplay: true, 44 autoplaySpeed: 8000, 45 accessibility: false, 46 responsive: [{ 47 breakpoint: 768, 48 settings: { 49 arrows: true, 50 dots: false, 51 lazyLoad: 'ondemand', 52 slidesToShow: 1 53 } 54 }, 55 { 56 breakpoint: 480, 57 settings: { 58 arrows: true, 59 dots: false, 60 lazyLoad: 'ondemand', 61 slidesToShow: 1 62 } 63 } 64 ] 65 }); 66 } 67 } 68 }; 69 70 getBrowserWidth(); 71 72 $(window).on('resize', function() { 73 getBrowserWidth(); 74 }); 75 76 }(jQuery)); 77 78// Mobile Menu Sidebar 79 jQuery('.mobilebtn').click(function(){ 80 jQuery(this).toggleClass("click"); 81 jQuery('.sidebar').toggleClass("show"); 82 $('.overlay').addClass('active'); 83 }); 84 85 jQuery('.sidebar ul li a').click(function(){ 86 var id = $(this).attr('id'); 87 jQuery('nav ul li ul.item-show-'+id).toggleClass("show"); 88 jQuery('nav ul li #'+id+' span').toggleClass("rotate"); 89 90 }); 91 92 jQuery('.float-end, .overlay').click(function() { 93 jQuery(this).removeClass("click"); 94 jQuery('.sidebar').removeClass("show"); 95 $('.overlay').removeClass('active'); 96 $('.sidebar').removeClass('active'); 97 }) ; 98 99// Off Canvas Menu Switch 100 101 (function($) { 102 var getBrowserWidth = function() { 103 if (window.innerWidth < 1023) { 104 $(init); 105 function init() { 106 $('#mobileMenuSidebar').append($('#desktopMenuFull')); 107 } 108 } else { 109 $(init); 110 function init() { 111 $('#desktopMenuFullWrapper').append($('#mobileMenuSidebar')); 112 } 113 } 114 }; 115 getBrowserWidth(); 116 $(window).on('resize', function() { 117 getBrowserWidth(); 118 }); 119 }(jQuery)); 120 121// Modal Popup 122 $(function() { 123 $('[data-modal]').on('click', function() { 124 $($(this).data('modal')).modal({ 125 fadeDuration: 250 126 }); 127 return false;
128 }); 129 }); 130 131 // Top Locations Dropdown 132 $(function(){ 133 $('.location-dropdown').on('click',function(event){ 134 135 event.preventDefault(); 136 $(this).toggleClass('selected'); 137 $(this).parent().find('ul').first().toggle(300); 138 139 $(this).parent().siblings().find('ul').hide(200); 140 141 //Hide menu when clicked outside 142 $(this).parent().find('ul').parent().mouseleave(function(){ 143 var thisUI = $(this); 144 $('html').click(function(){ 145 thisUI.children(".dropdown-menu").hide(); 146 thisUI.children("a").removeClass('selected'); 147 $('html').unbind('click'); 148 }); 149 }); 150 }); 151 }); 152 153 154// Lazy Loading Images 155document.addEventListener("DOMContentLoaded", function(event) { 156 var lazyImages =[].slice.call( 157 document.querySelectorAll(".lazyLoad > source") 158 ) 159 160 if ("IntersectionObserver" in window) { 161 let lazyImageObserver = 162 new IntersectionObserver(function(entries, observer) { 163 entries.forEach(function(entry) { 164 if (entry.isIntersecting) { 165 let lazyImage = entry.target; 166 lazyImage.srcset = lazyImage.dataset.srcset; 167 lazyImage.nextElementSibling.srcset = lazyImage.dataset.srcset; 168 lazyImage.nextElementSibling.classList.add('fade-in'); 169 lazyImage.parentElement.classList.remove("lazyLoad"); 170 lazyImageObserver.unobserve(lazyImage); 171 } 172 }); 173 }); 174 175 lazyImages.forEach(function(lazyImage) { 176 lazyImageObserver.observe(lazyImage); 177 }); 178 } else { 179 // Not supported, load all images immediately 180 lazyImages.forEach(function(image){ 181 image.nextElementSibling.src = image.nextElementSibling.dataset.srcset; 182 }); 183 } 184 }); 185 //////////////////////////////////////////////////////////////////////////////////location pages lazyload js 186 187 document.addEventListener("DOMContentLoaded", function() { 188 var lazyloadImages; 189 190 if ("IntersectionObserver" in window) { 191 lazyloadImages = document.querySelectorAll(".lazy"); 192 var imageObserver = new IntersectionObserver(function(entries, observer) { 193 entries.forEach(function(entry) { 194 if (entry.isIntersecting) { 195 var image = entry.target; 196 image.src = image.dataset.src; 197 image.classList.remove("lazy"); 198 imageObserver.unobserve(image); 199 } 200 }); 201 }); 202 203 lazyloadImages.forEach(function(image) { 204 imageObserver.observe(image); 205 }); 206 } else { 207 var lazyloadThrottleTimeout; 208 lazyloadImages = document.querySelectorAll(".lazy"); 209 210 function lazyload () { 211 if(lazyloadThrottleTimeout) { 212 clearTimeout(lazyloadThrottleTimeout); 213 } 214 215 lazyloadThrottleTimeout = setTimeout(function() { 216 var scrollTop = window.pageYOffset; 217 lazyloadImages.forEach(function(img) { 218 if(img.offsetTop < (window.innerHeight + scrollTop)) { 219 img.src = img.dataset.src; 220 img.classList.remove('lazy'); 221 } 222 }); 223 if(lazyloadImages.length == 0) { 224 document.removeEventListener("scroll", lazyload); 225 window.removeEventListener("resize", lazyload); 226 window.removeEventListener("orientationChange", lazyload); 227 } 228 }, 20); 229 } 230 231 document.addEventListener("scroll", lazyload); 232 window.addEventListener("resize", lazyload); 233 window.addEventListener("orientationChange", lazyload); 234 } 235}); 236 237 238 239
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.