diff --git a/src/routes/global.css b/src/routes/global.css index e5a49da..d8b5645 100644 --- a/src/routes/global.css +++ b/src/routes/global.css @@ -28,4 +28,5 @@ img.lazy-image { img.lazy-image.loaded { opacity: 1; + z-index:-1; } diff --git a/static/lazy.js b/static/lazy.js index 56464a3..9f008c2 100644 --- a/static/lazy.js +++ b/static/lazy.js @@ -5,6 +5,9 @@ window.onload = function(){ for (let i = 0; i < lazyImages.length; i++) { var element = lazyImages[i]; element.classList.add("lazy-image") + element.onload = function(){ + element.classList.add("loaded"); + } element.addEventListener("load", function(){ element.classList.add("loaded"); })