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 IntersectionObserverEntry mới.

Thuộc tính thể hiện

IntersectionObserverEntry.boundingClientRect Read 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ủa Element.getBoundingClientRect().

IntersectionObserverEntry.intersectionRatio Read only

Trả về tỷ lệ giữa intersectionRectboundingClientRect.

IntersectionObserverEntry.intersectionRect Read only

Trả về một DOMRectReadOnly biểu diễn vùng hiển thị của target.

IntersectionObserverEntry.isIntersecting Read only

Một giá trị Boolean là true nếu phần tử đích giao nhau với root của intersection observer. Nếu là true, IntersectionObserverEntry mô 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.rootBounds Read only

Trả về một DOMRectReadOnly cho root của intersection observer.

IntersectionObserverEntry.target Read only

Element mà phần giao nhau với root đã thay đổi.

IntersectionObserverEntry.time Read only

Một DOMHighResTimeStamp cho biết thời điểm phần giao nhau được ghi nhận, tính tương đối với time origin của IntersectionObserver.

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

Tương thích trình duyệt