1jQuery(function ($) { 2 // Function to lazyload images 3 if ('loading' in HTMLImageElement.prototype) { 4 var images = document.querySelectorAll("img.lazyload"); 5 images.forEach(function(img) { 6 img.src = img.dataset.src; 7 if(img.dataset.width){ 8 setTimeout(function(){ 9 img.width = img.dataset.width; 10 }, 1000); 11 } 12 if(img.dataset.height){ 13 setTimeout(function(){ 14 img.height = img.dataset.height; 15 }, 1000); 16 } 17 }); 18 } else { 19 // Dynamically import the LazySizes library 20 var script = document.createElement("script"); 21 script.async = true; 22 script.src = lazysizesFile; 23 document.body.appendChild(script); 24 } 25 // Function to lazyload background images, videos 26 $(function () { 27 $(".lazy").lazy(); 28 }); 29});
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.