Interface IntersectionObserver
interface IntersectionObserver {
root: Element | Document;
rootMargin: string;
thresholds: readonly number[];
disconnect(): void;
observe(target: Element): void;
takeRecords(): IntersectionObserverEntry[];
unobserve(target: Element): void;
}
root: Element | Document;
rootMargin: string;
thresholds: readonly number[];
disconnect(): void;
observe(target: Element): void;
takeRecords(): IntersectionObserverEntry[];
unobserve(target: Element): void;
}
Index
Properties
Methods
Properties
Readonly
root
Readonly
rootMargin
rootMargin : string
Readonly
thresholds
thresholds: readonly number[]
Methods
disconnect
observe
- observe(target): void
Parameters
- target: Element
Returns void
takeRecords
- take
Records (): IntersectionObserverEntry[] Returns IntersectionObserverEntry[]
unobserve
- unobserve(target): void
Parameters
- target: Element
Returns void
provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport.
MDN Reference