IntersectionObserverEntry:boundingClientRect 属性
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月.
IntersectionObserverEntry 接口的 boundingClientRect 只读属性返回一个 DOMRectReadOnly,该对象本质上描述了一个包含整个目标元素的最小矩形。
值
用于描述完全包含目标元素(当前正要描述相交状态变化的元素)的最小矩形的 DOMRectReadOnly。该值与 Element.getBoundingClientRect() 使用相同的算法生成结果,因此请参见相应文档以了解求得该矩形的确切步骤,以及该矩形边界内包含和不包含的内容。
不过,在一般情况下,你可以安全地将该值视作目标元素的边界矩形。
规范
| Specification |
|---|
| Intersection Observer> # dom-intersectionobserverentry-boundingclientrect> |