4 ms·
Good to keep in mind that nodelist is a live object. So manipulating that list while looping over it can yield surprising results.
by akira2501 3y ago
Good to keep in mind that nodelist is a live object. So manipulating that list while looping over it can yield surprising results.
- Kailhus 3y agoOr “is an element within viewport”, we now have IntersectionObserver for that sort of stuff. I guess it could be combined with the rects but if I remember correctly, the logic would fail if the element was bigger than the viewport.