aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/scrollmaxy/index.html
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/window/scrollmaxy/index.html
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/window/scrollmaxy/index.html')
-rw-r--r--files/zh-cn/web/api/window/scrollmaxy/index.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/window/scrollmaxy/index.html b/files/zh-cn/web/api/window/scrollmaxy/index.html
new file mode 100644
index 0000000000..3012d9d244
--- /dev/null
+++ b/files/zh-cn/web/api/window/scrollmaxy/index.html
@@ -0,0 +1,48 @@
+---
+title: Window.scrollMaxY
+slug: Web/API/Window/scrollMaxY
+tags:
+ - API
+ - DOM_0
+ - HTML DOM
+ - 参考
+ - 属性
+ - 非标准
+translation_of: Web/API/Window/scrollMaxY
+---
+<div>{{APIRef}} {{Non-standard_header}}</div>
+
+<p>只读属性<code><strong>Window.scrollMaxY</strong></code>返回<code>document</code>可以纵向滚动的最大像素数目</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox"><em>yMax</em> = window.scrollMaxY
+</pre>
+
+<ul>
+ <li><code>yMax</code> 是像素数。</li>
+</ul>
+
+<h2 id="例子">例子</h2>
+
+<pre class="brush:js">// 滚动到页面的底部
+let maxY = window.scrollMaxY;
+
+window.scrollTo(0, maxY);
+</pre>
+
+<h2 id="备注">备注</h2>
+
+<p>不要用 {{domxref("window.innerHeight")}} + window.scrollMaxY 来计算document的总高度,因为 {{domxref("window.innerHeight")}} 也包括了可见的水平滚动条的高度。正确的做法是使用 {{domxref("element.scrollHeight","document.body.scrollHeight")}} 。</p>
+
+<p>参见{{domxref("window.scrollMaxX")}} 和 {{domxref("window.scrollTo")}} 。</p>
+
+<h2 id="规范">规范</h2>
+
+<p id="comment_text_2">这不属于任何规范中的一部分。</p>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.Window.scrollMaxY")}}</p>