aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/range/getclientrects
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/range/getclientrects
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/range/getclientrects')
-rw-r--r--files/zh-cn/web/api/range/getclientrects/index.html56
1 files changed, 56 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/range/getclientrects/index.html b/files/zh-cn/web/api/range/getclientrects/index.html
new file mode 100644
index 0000000000..96de4d768a
--- /dev/null
+++ b/files/zh-cn/web/api/range/getclientrects/index.html
@@ -0,0 +1,56 @@
+---
+title: Range.getClientRects()
+slug: Web/API/Range/getClientRects
+tags:
+ - API
+ - CSSOM
+ - 参考
+ - 实验性
+ - 方法
+ - 范围
+translation_of: Web/API/Range/getClientRects
+---
+<div>{{ApiRef("DOM")}}</div>
+
+<p><strong><code>Range.getClientRects()</code></strong><strong> </strong>方法返回一个 {{ domxref("DOMRect") }} 对象列表,表示 <a href="/en/DOM/range" title="https://developer.mozilla.org/en/dom:range">range</a> 在屏幕上所占的区域。这个列表相当于汇集了范围中所有元素调用 {{ domxref("Element.getClientRects()") }} 方法所得的结果。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox notranslate"><em>rectList</em> = <em>range</em>.getClientRects()
+</pre>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js notranslate">range = document.createRange();
+range.selectNode(document.getElementsByTagName("div").item(0));
+rectList = range.getClientRects();
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">注释</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSSOM View', '#dom-range-getclientrects', 'Range.getClientRects()')}}</td>
+ <td>{{Spec2('CSSOM View')}}</td>
+ <td>Initial specification.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.Range.getClientRects")}}</p>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li>{{domxref("Range")}}</li>
+</ul>