IntersectionObserverEntry
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2019年3月.
* Some parts of this feature may have varying levels of support.
IntersectionObserverEntry は交差オブザーバー API のインターフェイスで、遷移の特定の瞬間における対象要素とそのルートコンテナー間の交差状態を表します。
IntersectionObserverEntry のインスタンスは、 IntersectionObserver のコールバックに entries 引数で渡されます。それ以外でこれらのオブジェクト取得することができるのは、 IntersectionObserver.takeRecords() を呼び出した場合のみです。
プロパティ
IntersectionObserverEntry.boundingClientRect読取専用-
対象要素の外接矩形を
DOMRectReadOnlyとして返します。境界はElement.getBoundingClientRect()の記事で説明されているのと同様に計算されます。 IntersectionObserverEntry.intersectionRatio読取専用-
intersectionRectとboundingClientRectの比率を返します。 IntersectionObserverEntry.intersectionRect読取専用-
対象の表示領域の矩形を表す
DOMRectReadOnlyを返します。 IntersectionObserverEntry.isIntersecting読取専用-
論理値で、対象要素が、この交差オブザーバーのルートに対象要素が交差したときは
trueになります。この値がtrueの場合、IntersectionObserverEntryは交差状態への変わり目にあることを示します。falseの場合、交差状態から交差なしへの変わり目であることがわかります。 IntersectionObserverEntry.rootBounds読取専用-
この交差オブザーバーのルートの矩形である
DOMRectReadOnlyを返します。 IntersectionObserverEntry.target読取専用-
ルートとの交差状態が変化した
Elementです。 IntersectionObserverEntry.time読取専用-
DOMHighResTimeStampで、このIntersectionObserverの時刻の起点を基準にして、交差が記録された時刻を示します。
メソッド
このインターフェイスにはメソッドがありません。
仕様書
| Specification |
|---|
| Intersection Observer> # intersection-observer-entry> |
ブラウザーの互換性
Loading…