feat(ui): show preview image in home page
This commit is contained in:
15
_javascript/modules/components/img-lazyload.js
Normal file
15
_javascript/modules/components/img-lazyload.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Set up 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');
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user