Update README with segments explainer · WICG/visual-viewport@fb277c9
ststimac
·
2021-09-27
·
via Recent Commits to visual-viewport:gh-pages
This repository was archived by the owner on Mar 12, 2026. It is now read-only.
| Original file line number | Diff line number | Diff line change |
|---|
@@ -94,12 +94,19 @@ visualViewport = {
|
94 | 94 | // viewport` (size at width=device-width). This |
95 | 95 | // is the same scale as used in the viewport |
96 | 96 | // <meta> tag. |
| 97 | + |
| 98 | + FrozenArray<DOMRect> segments; // Read-only. Returns an array of |
| 99 | + // DOMRects that represent the dimensions |
| 100 | + // of each existing viewport segment. |
| 101 | + |
97 | 102 | } |
98 | 103 | ``` |
99 | 104 | |
100 | 105 | * Fire a `scroll` event against `window.visualViewport` whenever the `offsetLeft` or `offsetTop` attributes change. |
101 | 106 | |
102 | 107 | * Fire a `resize` event against `window.visualViewport` whenever the `width` or `height` attributes change. |
| 108 | + |
| 109 | +* The viewport segments property is currently in development and experimental. Please view the [segments explainer](https://github.com/WICG/visual-viewport/tree/gh-pages/segments-explainer) for more details. |
103 | 110 | |
104 | 111 | ## Example |
105 | 112 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。