IntersectionObserverEntry
Baseline 广泛可用 *
IntersectionObserverEntry 接口是 Intersection Observer API 的一部分,它描述了在特定过渡时刻目标元素与其根容器的交叉情况。
IntersectionObserverEntry 的实例会传递给 IntersectionObserver 回调的 entries 参数;否则,只能通过调用 IntersectionObserver.takeRecords() 来获取这些对象。
实例属性
IntersectionObserverEntry.boundingClientRect只读-
以
DOMRectReadOnly的形式返回目标元素的边界矩形。边界的计算方法参见Element.getBoundingClientRect()的文档。 IntersectionObserverEntry.intersectionRatio只读-
返回
intersectionRect相对于boundingClientRect的比例。 IntersectionObserverEntry.intersectionRect只读-
返回一个
DOMRectReadOnly对象,表示目标元素的可见区域。 IntersectionObserverEntry.isIntersecting只读-
一个布尔值,如果目标元素与 intersection observer 的根交叉,则为
true。如果此值为true,则IntersectionObserverEntry描述了过渡到交叉状态;如果此值为false,则表示您知道过渡是从交叉状态到非交叉状态。 IntersectionObserverEntry.rootBounds只读-
返回 intersection observer 根的
DOMRectReadOnly对象。 IntersectionObserverEntry.target只读-
其与根元素的交叉发生变化的
Element。 IntersectionObserverEntry.time只读-
一个
DOMHighResTimeStamp,表示记录交叉时间的时间戳,相对于IntersectionObserver的 time origin。
实例方法
此接口没有方法。
规范
| 规范 |
|---|
| 交集观察器 # intersection-observer-entry |
浏览器兼容性
加载中…