From c075e11a4e5798ea1a71f0ef90e0f28a70d8a9d9 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Mon, 26 Jun 2023 21:54:20 +0800 Subject: [PATCH] Revert "fix: shimmer has the potential to cover images (#1100)" This reverts commit 74ab6f8adc2a7930e7bf21543ad17ded386c93c3. --- _javascript/modules/components/img-lazyload.js | 8 +++++++- _sass/addon/commons.scss | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/_javascript/modules/components/img-lazyload.js b/_javascript/modules/components/img-lazyload.js index 9e7593e..b79c87c 100644 --- a/_javascript/modules/components/img-lazyload.js +++ b/_javascript/modules/components/img-lazyload.js @@ -1,9 +1,15 @@ /** - * Setup image lazy-load + * Set up image lazy-load */ export function imgLazy() { if ($('#core-wrapper img[data-src]') <= 0) { return; } + + /* Stop shimmer when image loaded */ + document.addEventListener('lazyloaded', function (e) { + const $img = $(e.target); + $img.parent().removeClass('shimmer'); + }); } diff --git a/_sass/addon/commons.scss b/_sass/addon/commons.scss index 29d5bcf..fd48b8d 100644 --- a/_sass/addon/commons.scss +++ b/_sass/addon/commons.scss @@ -91,7 +91,6 @@ img { &.lazyloaded { -webkit-animation: fade-in 0.35s ease-in; animation: fade-in 0.35s ease-in; - z-index: 0; } }