diff options
Diffstat (limited to 'files/zh-cn/web/api/document/height/index.html')
| -rw-r--r-- | files/zh-cn/web/api/document/height/index.html | 50 |
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> |
