IntersectionObserverEntry
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 |
ブラウザーの互換性
BCD tables only load in the browser