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.
source
share