1(function() { 2 var elements = document.querySelectorAll('img[data-src]'); 3 var index = 0; 4 var lazyLoad = function() { 5 if (index >= elements.length) return; 6 var item = elements[index]; 7 if ((this.scrollY + this.innerHeight) > item.offsetTop) { 8 var src = item.getAttribute("data-src"); 9 item.src = src; 10 item.addEventListener('load', function() { 11 item.removeAttribute('data-src'); 12 13 }); 14 index++; 15 lazyLoad(); 16 } 17 }; 18 var init = function() { 19 window.addEventListener('scroll', lazyLoad); 20 lazyLoad(); 21 }; 22 return init(); 23})();
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.