Hacker News new | past | comments | ask | show | jobs | submit login

Why do you need to detect whether something is in the viewport?



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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: