-
Notifications
You must be signed in to change notification settings - Fork 42
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
Lazyloading? #39
Comments
Well here's one way of doing this that I've been testing. In the
Then in the place where the ad needs to display:
I've just started testing, but so far this appears to work (either in browsers that already support IntersectionObserver or with a polyfill). I need to investigate more so I can make sure it begins to load a few pixels before the ad is in view, and maybe some other things, but this appears to be a good start and would require no additions to this library at all, unless you'd want to document it. |
Hello @jonathanstegall |
@pm-harshad-mane yes, I think this ended up being what we use. I ultimately made a WordPress plugin that uses this library. |
@jonathanstegall Thank you for this! I didn't know something like IntersectionObserver existed, and it also helped me solve the LazyLoading issue! |
Expected Behavior
I'm hoping to learn if you've thought about incorporating lazy loading into this library. Perhaps with IntersectionObserver?
Actual Behavior
Currently all of the ads load when the page loads.
The text was updated successfully, but these errors were encountered: