mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-19 14:14:17 +00:00
chore(deps): use lazysizes to load images
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
/**
|
||||
Lazy load images (https://github.com/ApoorvSaxena/lozad.js)
|
||||
and popup when clicked (https://github.com/dimsemenov/Magnific-Popup)
|
||||
Set up image popup stuff (https://github.com/dimsemenov/Magnific-Popup)
|
||||
*/
|
||||
|
||||
$(function () {
|
||||
@@ -10,12 +9,6 @@ $(function () {
|
||||
return;
|
||||
}
|
||||
|
||||
/* lazy loading */
|
||||
|
||||
const imgList = document.querySelectorAll(`${IMG_SCOPE} img[data-src]`);
|
||||
const observer = lozad(imgList);
|
||||
observer.observe();
|
||||
|
||||
/* popup */
|
||||
|
||||
$(`${IMG_SCOPE} p > img[data-src], ${IMG_SCOPE} img[data-src].preview-img`).each(
|
||||
|
||||
Reference in New Issue
Block a user