mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
more JS 💀
This commit is contained in:
parent
0cc5f70e4f
commit
9e788b0cec
3 changed files with 10 additions and 11 deletions
|
@ -9,7 +9,7 @@ function loadOnView() {
|
|||
const webpSupport = checkWebpSupport();
|
||||
|
||||
for (let i = 0; i < lazyLoad.length; i++) {
|
||||
let image = lazyLoad[i];
|
||||
const image = lazyLoad[i];
|
||||
if (image.getBoundingClientRect().top < window.innerHeight && image.getBoundingClientRect().bottom > 0) {
|
||||
if (!image.src && webpSupport) {
|
||||
image.src = `${image.getAttribute('data-src')}&e=webp`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue