fix: pleeeeaase work!
This commit is contained in:
parent
43c862fbfd
commit
df3afc90a7
@ -6,11 +6,13 @@ window.onload = function () {
|
|||||||
lazyImages.forEach(function (lazyImage) {
|
lazyImages.forEach(function (lazyImage) {
|
||||||
lazyImage.style.opacity = 0;
|
lazyImage.style.opacity = 0;
|
||||||
lazyImage.classList.add("lazy-image")
|
lazyImage.classList.add("lazy-image")
|
||||||
|
console.log(lazyImage)
|
||||||
|
|
||||||
// Create an image element to check when it's loaded
|
// Create an image element to check when it's loaded
|
||||||
var img = new Image();
|
var img = new Image();
|
||||||
img.src = lazyImage.src;
|
img.src = lazyImage.src;
|
||||||
img.onload = function () {
|
img.onload = function () {
|
||||||
|
console.log("lloooaded")
|
||||||
lazyImage.style.opacity = 1;
|
lazyImage.style.opacity = 1;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user