Skip to content

Commit 592ab1d

Browse files
committed
Fix endless shimmering issue for preview images with lazy loading disabled
1 parent 62b1f9a commit 592ab1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

_javascript/modules/components/img-loading.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ export function loadImg() {
4747
});
4848

4949
// Images loaded from the browser cache do not trigger the 'load' event
50-
document.querySelectorAll('article img[loading="lazy"]').forEach((img) => {
51-
if (img.complete) {
50+
// Modified by Yunseo Kim: Images without both loading=“lazy” attribute and data-lqip attribute also do not trigger 'load' event
51+
document.querySelectorAll('article img').forEach((img) => {
52+
if (!img.hasAttribute(ATTR_DATA_LQIP) && img.complete) {
5253
removeCover.call(img, cover.SHIMMER);
5354
}
5455
});

0 commit comments

Comments
 (0)