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/focus/index.html | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 files/zh-cn/web/api/window/focus/index.html (limited to 'files/zh-cn/web/api/window/focus/index.html') diff --git a/files/zh-cn/web/api/window/focus/index.html b/files/zh-cn/web/api/window/focus/index.html new file mode 100644 index 0000000000..984020d0e5 --- /dev/null +++ b/files/zh-cn/web/api/window/focus/index.html @@ -0,0 +1,41 @@ +--- +title: Window.focus() +slug: Web/API/Window/focus +tags: + - API +translation_of: Web/API/Window/focus +--- +

{{APIRef}}

+ +

概述

+ +

请求将窗口显示在前(靠近屏幕),这可能由于用户设置而失败,并且该窗口在方法返回之前不能保证会显示在最前.

+ +

语法

+ +
window.focus()
+
+ +

示例

+ +
if (clicked) { window.focus(); }
+
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG','interaction.html#dom-window-focus','Window.focus()')}}{{Spec2('HTML WHATWG')}} 
+ +

{{ languages( { "ja": "ja/DOM/window.focus", "pl": "pl/DOM/window.focus" } ) }}

-- cgit v1.2.3-54-g00ecf