大网数据广告活动
Web 标准与前端开发

IntersectionObserverEntry

· 52CE 我爱测

`IntersectionObserverEntry 接口`** (从属于 Intersection Observer API ) 描述了目标元素与其根元素容器在某一特定过渡时刻的交叉状态。`IntersectionObserverEntry` 的实例作为 `entries` 参数被传递到一个 IntersectionObserver 的回调函数中; 此外,这些对象只能通过调用IntersectionObserver.takeRecords() 来获取。

Intersection Observer API

IntersectionObserverEntry 接口 (从属于 Intersection Observer API ) 描述了目标元素与其根元素容器在某一特定过渡时刻的交叉状态。IntersectionObserverEntry 的实例作为 entries 参数被传递到一个 IntersectionObserver 的回调函数中; 此外,这些对象只能通过调用IntersectionObserver.takeRecords() 来获取。

属性

  • IntersectionObserverEntry.boundingClientRect
    • : 返回包含目标元素的边界信息的DOMRectReadOnly. 边界的计算方式与 Element.getBoundingClientRect() 相同。
  • IntersectionObserverEntry.intersectionRatio
    • : 返回intersectionRect 与 boundingClientRect 的比例值。
  • IntersectionObserverEntry.intersectionRect
    • : 返回一个 DOMRectReadOnly 用来描述根和目标元素的相交区域。
  • IntersectionObserverEntry.isIntersecting
    • : 返回一个布尔值,如果目标元素与交叉区域观察者对象 (intersection observer) 的根相交,则返回 true .如果返回 true, 则 IntersectionObserverEntry 描述了变换到交叉时的状态; 如果返回 false, 那么可以由此判断,变换是从交叉状态到非交叉状态。
  • IntersectionObserverEntry.rootBounds
    • : 返回一个 DOMRectReadOnly 用来描述交叉区域观察者 (intersection observer) 中的根。
  • IntersectionObserverEntry.target
    • : 与根出现相交区域改变的元素 (Element).
  • IntersectionObserverEntry.time
    • : 返回一个记录从 IntersectionObserver 的时间原点 (time origin) 到交叉被触发的时间的时间戳 (DOMHighResTimeStamp).

方法

此接口没有方法。

规范

浏览器兼容性

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。