fix: shimmer has the potential to cover images (#1100)

Resolves #1100
This commit is contained in:
Cotes Chung 2023-06-24 21:23:30 +08:00
parent 4fe145e980
commit 74ab6f8adc
No known key found for this signature in database
GPG key ID: 0D9E54843167A808
2 changed files with 2 additions and 7 deletions

View file

@ -1,15 +1,9 @@
/** /**
* Set up image lazy-load * Setup image lazy-load
*/ */
export function imgLazy() { export function imgLazy() {
if ($('#core-wrapper img[data-src]') <= 0) { if ($('#core-wrapper img[data-src]') <= 0) {
return; return;
} }
/* Stop shimmer when image loaded */
document.addEventListener('lazyloaded', function (e) {
const $img = $(e.target);
$img.parent().removeClass('shimmer');
});
} }

View file

@ -91,6 +91,7 @@ img {
&.lazyloaded { &.lazyloaded {
-webkit-animation: fade-in 0.35s ease-in; -webkit-animation: fade-in 0.35s ease-in;
animation: fade-in 0.35s ease-in; animation: fade-in 0.35s ease-in;
z-index: 0;
} }
} }