Intersection observerBaseline · Widely available
The IntersectionObserver API asynchronously observes changes in the intersection of a target element with an ancestor element or with a top-level document's viewport.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 25, 2019. Widely available since Sep 25, 2021.
Browser support
DesktopChrome
1–57Not supported
58+Supportedsince Apr 19, 2017
Current: 155Edge
12–15Not supported
16+Supportedsince Oct 17, 2017
Current: 154Firefox
1–54Not supported
55+Supportedsince Aug 8, 2017
Current: 157Safari
1–12Not supported
12.1+Supportedsince Mar 25, 2019
Current: 27MobileChrome Android
18–57Not supported
58+Supportedsince Apr 25, 2017
Current: 155Firefox Android
4–54Not supported
55+Supportedsince Aug 8, 2017
Current: 157Safari iOS
1–12Not supported
12.2+Supportedsince Mar 25, 2019
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
JS
const observer = new IntersectionObserver((entries) => {
for (const entry of entries) {
if (entry.isIntersecting) {
entry.target.classList.add("visible");
observer.unobserve(entry.target);
}
}
}, { rootMargin: "0px 0px -10% 0px" });
document.querySelectorAll(".reveal").forEach((el) => observer.observe(el));Feature detection
JS · check before using
if ("IntersectionObserver" in globalThis) {
// IntersectionObserver is available
} else {
// load a polyfill or use a fallback
}Sub-features
Support for each part of the feature (23). The overall table above shows when the whole feature works.
Show 3 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| IntersectionObserverEntry.rootBounds | 51 | 15 | 55 | 12.1 | 51 | 55 | 12.2 |
| IntersectionObserverEntry.target | 51 | 15 | 55 | 12.1 | 51 | 55 | 12.2 |
| IntersectionObserverEntry.time | 51 | 15 | 55 | 12.1 | 51 | 55 | 12.2 |