1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 21:53:26 +00:00

Preventing image reflow (fix #351)

This commit is contained in:
Cotes Chung
2021-06-30 19:08:42 +08:00
parent 08ec6cd3b5
commit 6d1d440c00
4 changed files with 55 additions and 12 deletions

View File

@@ -11,10 +11,10 @@ $(function() {
return;
}
/* lozy loading */
/* lazy loading */
const imgs = document.querySelectorAll(`${IMG_SCOPE} img[data-src]`);
const observer = lozad(imgs);
const imgList = document.querySelectorAll(`${IMG_SCOPE} img[data-src]`);
const observer = lozad(imgList);
observer.observe();
/* popup */
@@ -40,9 +40,8 @@ $(function() {
}
});
/* markup the image links */
$(`${IMG_SCOPE} a`).has("img").addClass('img-link');
});