window.onload = function(){ var lazyImages = [...document.querySelectorAll("img[loading='lazy']")]; for (let i = 0; i < lazyImages.length; i++) { var element = lazyImages[i]; element.classList.add("lazy-image") element.addEventListener("load", function(){ element.classList.add("loaded"); }) } }