Is there an HTML5 equivalent of IntersectionObserver to measure how far an element has been removed from the root?

The HTML5 IntersectionObserver API lets you know how many items are displayed on the screen, see here .

I would like to measure (in pixels or%) how far the element is from the top viewport. I know it is possible to do this with janky js scroll events, but I would like to do it in HTML5.

+4
source share

Source: https://habr.com/ru/post/1684021/


All Articles