CSS, Lazy Loading, JavaScript, Tutorial, Javascript Tips.
document.addEventListener('DOMContentLoaded', load); }); Wait until image is visible document.querySelectorAll('img[data-src]').forEach(img => { var load = lazyLoad(img).load; checkViewport(); window.addEventListener('scroll', checkViewport); window.addEventListener('resize', checkViewport);