From 727e9ae9eda006e533ebd1d9212a32728d211af4 Mon Sep 17 00:00:00 2001 From: ZhengJin Fang Date: Wed, 10 Nov 2021 16:27:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20PDF/word=E5=9B=BE=E7=89=87=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E9=A2=84=E8=A7=88=E6=97=B6,=20=E4=B8=8B=E7=BF=BB?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=97=B6=E9=A2=91=E7=B9=81=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/main/resources/static/js/lazyload.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/main/resources/static/js/lazyload.js b/server/src/main/resources/static/js/lazyload.js index 5beff487..206459ff 100644 --- a/server/src/main/resources/static/js/lazyload.js +++ b/server/src/main/resources/static/js/lazyload.js @@ -19,8 +19,12 @@ function checkImgs() { } function loadImg(el) { - var source = el.getAttribute("data-src"); - el.src = source; + var loaded = el.getAttribute("loaded"); + if (!Boolean(loaded)) { + var source = el.getAttribute("data-src"); + el.setAttribute("loaded", true); + el.src = source; + } } // var mustRun = 500 // function throttle(fn, mustRun) {