/IntersectionObserver-Examples

Some exemplary implementations of the Intersection Observer API

Primary LanguageHTML

IntersectionObserver Examples

IntersectionObserver

The IntersectionObserver API provides an API to understand the visibility and position of DOM elements relative to a containing element or to the top-level viewport.

https://googlechrome.github.io/samples/intersectionobserver/index.html

Or in other words: IntersectionObserver lets you know when an element enters or leaves the viewport without the need of calling getBoundingClientRect() or scroll event handlers.

Examples

Browser Support

For now Chrome 51+ and Chrome Canary, but there's a polyfill in the making.

Additional ressources