From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/document/height/index.html | 50 ++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 files/zh-cn/web/api/document/height/index.html (limited to 'files/zh-cn/web/api/document/height') 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 +--- +
{{APIRef("DOM")}} {{Obsolete_header}}
+ +

 

+ +
+

Note: 在Gecko的6.0版本之后, document.height 不再被支持。 使用 document.body.clientHeight来代替. 详见 {{domxref("element.clientHeight")}}.

+
+ +

返回 {{domxref("document")}} 对象的高度. 在大多数场景中, 它相当于当前文档的 {{HTMLElement("body")}} 元素。

+ +

语法

+ +
pixels = document.height
+
+ +

示例

+ +
// alert document height
+alert(document.height);
+
+ +

可选操作

+ +
document.body.clientHeight
+document.documentElement.clientHeight
+document.documentElement.scrollHeight
+
+ +

规范

+ +

HTML5

+ +

兼容性

+ + + +

{{Compat("api.Document.height")}}

+ +

另请参阅

+ + -- cgit v1.2.3-54-g00ecf