-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
How to use Lazyload with images in scrollable DIV? What is root for? #455
Comments
Hi @q2apro The Library is using Intersection Observer API to check whether HTML elements are in the viewport or not! Per the MDN docs, |
In other words, defining a DIV would be valid. From their website:
|
Yes, it should be valid! 👌🏼 |
I have finally tried it, but it does not work. No lazy load trigger when I scroll the DIV up/down. I have a fixed width and height for the DIV and use CSS I had problems with CSS's overflow in the past, so maybe it is also the culprit here. I could not find issues searching the net, just this here: https://stackoverflow.com/questions/72077165/using-intersectionobserver-instead-of-onscroll-event Update: I also posted this issue at https://stackoverflow.com/q/77313611/1066234 |
I have not a scrollable body, but a scrollable DIV.
Since the scrolling does not happen on the body, the lazyload images are not loaded.
I have seen:
But in the readme/doc there is not mentioned what
root
is.Can I just define the div for root, e.g.
root: $('.wrapper'),
?The text was updated successfully, but these errors were encountered: