Hacker News new | ask | show | jobs
by rjbwork 3231 days ago
Why do you need to detect whether something is in the viewport?
2 comments

For lazyloading stuff like images and ads. Or that technique where you have an infinite list, and the elements that are scrolled off-screen are recycled on the other end.
You can easily scroll so that the intersection observer sentinels are not seen and cause bugs. Disappointing.
The linked description provides several use cases.