aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/focus
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/focus
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/focus')
-rw-r--r--files/zh-cn/web/api/window/focus/index.html41
1 files changed, 41 insertions, 0 deletions
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
+---
+<p>{{APIRef}}</p>
+
+<h2 id="概述">概述</h2>
+
+<p>请求将窗口显示在前(靠近屏幕),这可能由于用户设置而失败,并且该窗口在方法返回之前不能保证会显示在最前.</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="eval">window.focus()
+</pre>
+
+<h2 id="Example" name="Example">示例</h2>
+
+<pre class="eval">if (clicked) { window.focus(); }
+</pre>
+
+<h2 id="Specification" name="Specification">规范</h2>
+
+<table class="spectable standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG','interaction.html#dom-window-focus','Window.focus()')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<p>{{ languages( { "ja": "ja/DOM/window.focus", "pl": "pl/DOM/window.focus" } ) }}</p>