Is there a way in JavaScript to get element's visible part? E.g. I have elements that are being scrolled and I need to know whether the element is fully visible or partially and understand what part is visible.
Asked
Active
Viewed 33 times
2
-
You can use the [IntersectionObserver API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API). You can attach your listener to the desired element and have it tell you exactly when (and how much of) it is visible. – iuliu.net Dec 21 '18 at 08:49