From 74ab6f8adc2a7930e7bf21543ad17ded386c93c3 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Sat, 24 Jun 2023 21:23:30 +0800 Subject: [PATCH] fix: shimmer has the potential to cover images (#1100) Resolves #1100 --- _javascript/modules/components/img-lazyload.js | 8 +------- _sass/addon/commons.scss | 1 + 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/_javascript/modules/components/img-lazyload.js b/_javascript/modules/components/img-lazyload.js index b79c87c..9e7593e 100644 --- a/_javascript/modules/components/img-lazyload.js +++ b/_javascript/modules/components/img-lazyload.js @@ -1,15 +1,9 @@ /** - * Set up image lazy-load + * Setup 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 2cec92c..dbc5f06 100644 --- a/_sass/addon/commons.scss +++ b/_sass/addon/commons.scss @@ -91,6 +91,7 @@ img { &.lazyloaded { -webkit-animation: fade-in 0.35s ease-in; animation: fade-in 0.35s ease-in; + z-index: 0; } }