Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picture element has its image loaded before the users scrolls to it. #82

Closed
Fb16455 opened this issue Feb 15, 2020 · 2 comments
Closed

Comments

@Fb16455
Copy link

Fb16455 commented Feb 15, 2020

Hi.

I have a page with 6 images that are loaded using 5 <img> elements and 1 <picture> element. With the exception of the first image, all the other are lazy loaded using yall.js.

The images loaded in the s are lazy loaded correctly, but the image loaded in the picture element get loaded before the user scrolls to it.

Here's the page: https://lazyloadingtest.netlify.com/yall.html

If you open the network tab in devtools, you can see that images 1, 2 and 6 are loaded. As image 6 is at the bottom of the page, therefore outside the viewport, it should be hidden until the user reaches it in some way.

Why it's not waiting to load images inside only when it's necessary?

@malchata malchata changed the title Picture element has its image loaded before the users srolls to it. Picture element has its image loaded before the users scrolls to it. Apr 21, 2020
@verlok
Copy link

verlok commented May 17, 2020

Hey @Fb16455 ,
have you tried https://github.com/verlok/lazyload ?
It does pretty much the same and it’s working zero bugs for years.

@nitindutta5
Copy link

Facing the same issue. @Fb16455 Were you able to solve it?

@malchata malchata closed this as completed Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants