懒加载同时加载水印

This commit is contained in:
陈精华
2022-12-13 17:56:35 +08:00
parent 3dcd183171
commit 5ecb5f667d

View File

@@ -19,12 +19,9 @@ function checkImgs() {
}
function loadImg(el) {
var loaded = el.getAttribute("loaded");
if (!Boolean(loaded)) {
var source = el.getAttribute("data-src");
el.setAttribute("loaded", true);
el.src = source;
}
var source = el.getAttribute("data-src");
el.src = source;
}
// var mustRun = 500
// function throttle(fn, mustRun) {