Initial commit: plantilla base PHP para webs Acai CMS
This commit is contained in:
1
template/estandar/js/lazy-loader.js
Executable file
1
template/estandar/js/lazy-loader.js
Executable file
@@ -0,0 +1 @@
|
||||
function _checkImages(){var e,t=window.scrollY,n=t+window.innerHeight;document.querySelectorAll("img[data-src]").forEach(function(i){(e=i.getBoundingClientRect()).top+i.clientHeight>=t&&e.top<=n+i.clientHeight&&(i.setAttribute("src",i.getAttribute("data-src")),i.onload=function(){i.removeAttribute("data-src")})})}window.addEventListener("scroll",function(e){_checkImages()}),window.addEventListener("resize",function(e){_checkImages()});_checkImages();
|
||||
Reference in New Issue
Block a user