LayoutShiftAttribution: node property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Thuộc tính chỉ đọc node của giao diện LayoutShiftAttribution trả về một Node đại diện cho đối tượng đã bị dịch chuyển.
Giá trị
Một Node.
Ví dụ
Ví dụ sau in node của phần tử đầu tiên trong LayoutShift.sources vào bảng điều khiển.
js
new PerformanceObserver((list) => {
for (const { sources } of list.getEntries()) {
if (sources) {
console.log(sources[0].node);
}
}
}).observe({ type: "layout-shift", buffered: true });
Thông số kỹ thuật
| Specification |
|---|
| Layout Instability API> # dom-layoutshiftattribution-node> |