PageSourceSearch

https://www.ekusheysangbad.com/asset/js/lazyload.js

js ekusheysangbad.com collected 2026-09-25 01:21:29 UTC 2,641 bytes, 15 lines download raw bytes

1/*!
2* Lazy Load Images without jQuery
3* http://kaizau.github.com/Lazy-Load-Images-without-jQuery/
4*
5* Original by Mike Pulaski - http://www.mikepulaski.com
6* Modified by Kai Zau - http://kaizau.com
7*/(function(){var addEventListener=window.addEventListener||function(n,f){window.attachEvent('on'+n,f);},removeEventListener=window.removeEventListener||function(n,f,b){window.detachEvent('on'+n,f);};var lazyLoader={cache:[],mobileScreenSize:500,addObservers:function(){addEventListener('scroll',lazyLoader.throttledLoad);addEventListener('resize',lazyLoader.throttledLoad);},removeObservers:function(){removeEventListener('scroll',lazyLoader.throttledLoad,false);removeEventListener('resize',lazyLoader.throttledLoad,false);},throttleTimer:new Date().getTime(),throttledLoad:function(){var now=new Date().getTime();if((now-lazyLoader.throttleTimer)>=200){lazyLoader.throttleTimer=now;lazyLoader.loadVisibleImages();}},loadVisibleImages:function(){var scrollY=window.pageYOffset||document.documentElement.scrollTop;var pageHeight=window.innerHeight||document.documentElement.clientHeight;var range={min:scrollY-200,max:scrollY+pageHeight+200};var i=0;while(i<lazyLoader.cache.length){var image=lazyLoader.cache[i];var imagePosition=getOffsetTop(image);var imageHeight=image.height||0;if((imagePosition>=range.min-imageHeight)&&(imagePosition<=range.max)){var mobileSrc=image.getAttribute('data-src-mobile');image.onload=function(){this.className=this.className.replace(/(^|\s+)lazy-load(\s+|$)/,'$1lazy-loaded$2');};if(mobileSrc&&screen.width<=lazyLoader.mobileScreenSize){image.src=mobileSrc;}
8else{image.src=image.getAttribute('data-src');}
9image.removeAttribute('data-src');image.removeAttribute('data-src-mobile');lazyLoader.cache.splice(i,1);continue;}
10i++;}
11if(lazyLoader.cache.length===0){lazyLoader.removeObservers();}},init:function(){if(!document.querySelectorAll){document.querySelectorAll=function(selector){var doc=document,head=doc.documentElement.firstChild,styleTag=doc.createElement('STYLE');head.appendChild(styleTag);doc.__qsaels=[];styleTag.styleSheet.cssText=selector+"{x:expression(document.__qsaels.push(this))}";window.scrollBy(0,0);return doc.__qsaels;}}
12addEventListener('load',function _lazyLoaderInit(){var imageNodes=document.querySelectorAll('img[data-src]');for(var i=0;i<imageNodes.length;i++){var imageNode=imageNodes[i];lazyLoader.cache.push(imageNode);}
13lazyLoader.addObservers();lazyLoader.loadVisibleImages();removeEventListener('load',_lazyLoaderInit,false);});}}
14function getOffsetTop(el){var val=0;if(el.offsetParent){do{val+=el.offsetTop;}while(el=el.offsetParent);return val;}}
15lazyLoader.init();})();

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.