1document.addEventListener('DOMContentLoaded', function () { 2 let lazyImages = [].slice.call(document.querySelectorAll('.lazyLoad')); 3 let active = false; 4 5 const lazyLoad = function () { 6 if (!active) { 7 active = true; 8 9 setTimeout(function () { 10 lazyImages.forEach(function (lazyImage) { 11 if ((lazyImage.getBoundingClientRect().top <= window.innerHeight - 120 && lazyImage.getBoundingClientRect().bottom >= 0) && getComputedStyle(lazyImage).display !== 'none') { 12 lazyImage.src = lazyImage.dataset.src; 13 lazyImage.classList.remove('lazy'); 14 15 lazyImages = lazyImages.filter(function (image) { 16 return image !== lazyImage; 17 }); 18 19 if (lazyImages.length === 0) { 20 document.removeEventListener('scroll', lazyLoad); 21 window.removeEventListener('resize', lazyLoad); 22 window.removeEventListener('orientationchange', lazyLoad); 23 } 24 } 25 }); 26 27 active = false; 28 }, 200); 29 } 30 }; 31 lazyLoad(); 32 document.addEventListener('scroll', lazyLoad); 33 window.addEventListener('resize', lazyLoad); 34 window.addEventListener('orientationchange', lazyLoad); 35});
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.