aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/document/height
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/document/height
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/document/height')
-rw-r--r--files/zh-cn/web/api/document/height/index.html50
1 files changed, 50 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/document/height/index.html b/files/zh-cn/web/api/document/height/index.html
new file mode 100644
index 0000000000..8ace6753ec
--- /dev/null
+++ b/files/zh-cn/web/api/document/height/index.html
@@ -0,0 +1,50 @@
+---
+title: Document.height
+slug: Web/API/Document/height
+translation_of: Web/API/Document/height
+---
+<div>{{APIRef("DOM")}} {{Obsolete_header}}</div>
+
+<p> </p>
+
+<div class="note">
+<p><strong>Note:</strong> 在Gecko的6.0版本之后, <code>document.height</code> 不再被支持。 使用 <code>document.body.clientHeight来代替</code>. 详见 {{domxref("element.clientHeight")}}.</p>
+</div>
+
+<p>返回 {{domxref("document")}} 对象的高度. 在大多数场景中, 它相当于当前文档的 {{HTMLElement("body")}} 元素。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox notranslate"><var>pixels</var> = document.height
+</pre>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: js notranslate">// alert document height
+alert(document.height);
+</pre>
+
+<h2 id="可选操作">可选操作</h2>
+
+<pre class="syntaxbox notranslate">document.body.clientHeight
+document.documentElement.clientHeight
+document.documentElement.scrollHeight
+</pre>
+
+<h2 id="规范">规范</h2>
+
+<p>HTML5</p>
+
+<h2 id="兼容性">兼容性</h2>
+
+
+
+<p>{{Compat("api.Document.height")}}</p>
+
+<h2 id="另请参阅">另请参阅</h2>
+
+<ul>
+ <li>{{domxref("document.width")}}</li>
+ <li>{{domxref("Element.clientHeight")}}</li>
+ <li>{{domxref("Element.scrollHeight")}}</li>
+</ul>