IntersectionObserverEntry
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2019.
* Some parts of this feature may have varying levels of support.
Giao diện IntersectionObserverEntry của Intersection Observer API mô tả phần giao nhau giữa phần tử đích và vùng chứa root của nó tại một thời điểm chuyển trạng thái cụ thể.
Các thể hiện IntersectionObserverEntry được chuyển vào đối số entries của callback IntersectionObserver; ngoài ra, các đối tượng này chỉ có thể nhận được bằng cách gọi IntersectionObserver.takeRecords().
Hàm tạo
IntersectionObserverEntry()Experimental-
Tạo một đối tượng
IntersectionObserverEntrymới.
Thuộc tính thể hiện
IntersectionObserverEntry.boundingClientRectRead only-
Trả về hình chữ nhật biên của phần tử đích dưới dạng
DOMRectReadOnly. Các biên này được tính như mô tả trong tài liệu củaElement.getBoundingClientRect(). IntersectionObserverEntry.intersectionRatioRead only-
Trả về tỷ lệ giữa
intersectionRectvàboundingClientRect. IntersectionObserverEntry.intersectionRectRead only-
Trả về một
DOMRectReadOnlybiểu diễn vùng hiển thị của target. IntersectionObserverEntry.isIntersectingRead only-
Một giá trị Boolean là
truenếu phần tử đích giao nhau với root của intersection observer. Nếu làtrue,IntersectionObserverEntrymô tả một chuyển đổi vào trạng thái giao nhau; nếu làfalse, bạn biết rằng nó đã chuyển từ giao nhau sang không giao nhau. IntersectionObserverEntry.rootBoundsRead only-
Trả về một
DOMRectReadOnlycho root của intersection observer. IntersectionObserverEntry.targetRead only-
Elementmà phần giao nhau với root đã thay đổi. IntersectionObserverEntry.timeRead only-
Một
DOMHighResTimeStampcho biết thời điểm phần giao nhau được ghi nhận, tính tương đối với time origin củaIntersectionObserver.
Phương thức thể hiện
Giao diện này không có phương thức nào.
Thông số kỹ thuật
| Specification |
|---|
| Intersection Observer> # intersection-observer-entry> |