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/window/moveby/index.html | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 files/zh-cn/web/api/window/moveby/index.html (limited to 'files/zh-cn/web/api/window/moveby') diff --git a/files/zh-cn/web/api/window/moveby/index.html b/files/zh-cn/web/api/window/moveby/index.html new file mode 100644 index 0000000000..3e1ad67e96 --- /dev/null +++ b/files/zh-cn/web/api/window/moveby/index.html @@ -0,0 +1,34 @@ +--- +title: Window.moveBy() +slug: Web/API/Window/moveBy +translation_of: Web/API/Window/moveBy +--- +
+ {{APIRef}}
+

概述

+

根据指定的值,移动当前窗口。

+

语法

+
window.moveBy(deltaX, deltaY)
+
+

参数

+ +

示例

+
function budge() {
+  moveBy(10, -10);
+}
+

备注

+

可以使用负值作为该函数的参数。该函数产生相对移动,而 {{domxref("window.moveTo")}} 产生一个绝对移动。

+

从 Firefox 7 开始,依据下面的规则不能再移动一个浏览器里的窗口。

+
    +
  1. 不能移动非 window.open 创建的窗口或 Tab。
  2. +
  3. 当一个窗口里有多于一个 Tab 时,不能移动该窗口。
  4. +
+

规范

+

{{dom0}}

+

相关链接

+ -- cgit v1.2.3-54-g00ecf