aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/resizeby
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/resizeby
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/resizeby')
-rw-r--r--files/zh-cn/web/api/window/resizeby/index.html43
1 files changed, 43 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/window/resizeby/index.html b/files/zh-cn/web/api/window/resizeby/index.html
new file mode 100644
index 0000000000..ad8419af50
--- /dev/null
+++ b/files/zh-cn/web/api/window/resizeby/index.html
@@ -0,0 +1,43 @@
+---
+title: Window.resizeBy()
+slug: Web/API/Window/resizeBy
+translation_of: Web/API/Window/resizeBy
+---
+<div>{{APIRef}}</div>
+
+<h2 id="Summary" name="Summary">概述</h2>
+
+<p>调整窗口大小。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre class="syntaxbox">window.resizeBy(<em>xDelta</em>, <em>yDelta</em>)
+</pre>
+
+<h3 id="Parameters" name="Parameters">参数</h3>
+
+<ul>
+ <li><code>xDelta</code> 为窗口水平方向变化的像素值。</li>
+ <li><code>yDelta</code> 为窗口垂直方向变化的像素值。</li>
+</ul>
+
+<h2 id="Example" name="Example">例子</h2>
+
+<pre class="brush:js">// 缩小窗口
+window.resizeBy(-200, -200);
+</pre>
+
+<h2 id="Notes" name="Notes">备注</h2>
+
+<p>该方法相对于窗口当前大小来调整该窗口的大小。要以绝对大小方式调整窗口的大小,可使用 {{domxref("window.resizeTo")}}。</p>
+
+<p>从 Firefox 7,依据<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=565541#c24">下面的规则</a>,不能再调整浏览器内一个窗口的默认大小了:</p>
+
+<ol>
+ <li>不能调整非 window.open 方法打开的窗口或 Tab 的大小。</li>
+ <li>当一个窗口内包含有一个以上的 Tab 时,不能调整窗口的大小。</li>
+</ol>
+
+<h2 id="Specification" name="Specification">规范</h2>
+
+<p>DOM Level 0。不属于规范。</p>