DEV Community

Discussion on: Native lazy loading is landed in Chrome 🔥😍🔥

Collapse
 
dacko_m profile image
Dragan Malinović

Does this work with divs or other elements that have overflow:auto? Or just with scrolling the body element?

Or for example modals that are in dom and have images with lazy loading attribute, but are positioned outside the view and waiting to be shown with top:0 for example?

Collapse
 
yashints profile image
Yaser Adel Mehraban

Yes, for divs with overflow auto it will work fine. However, I am not too sure about Modals, have a look at the Distance Threshold to see how close to coming into viewport should the element be to trigger the request.

PS: If you gave it a shot for Modals, let me know and I'll update the article, that's a good one. I will try to test it myself later this week too