aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/getattention/index.html
blob: f17531eb18790cf5ea753ba2b8eeb5c37ee46435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
title: Window.getAttention()
slug: Web/API/Window/getAttention
translation_of: Web/API/Window/getAttention
---
<div>{{ ApiRef() }}</div>

<p>The <code><strong>Window.getAttention()</strong></code> method attempts to get the user's attention. The mechanism for this happening depends on the specific operating system and window manager.</p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox">window.getAttention();
</pre>

<h2 id="Notes">Notes</h2>

<p>On Windows, the taskbar button for the window flashes, if this hasn't been disabled by the user.</p>

<p>On Linux, the behaviour varies from window manager to window manager - some flash the taskbar button, others focus the window immediately. This may be configurable as well.</p>

<p>On Macintosh, the icon in the upper right corner of the desktop flashes.</p>

<p>The function is disabled for web content. Neither Gecko nor Internet Explorer supports this feature now for web content. <code>getAttention</code> will still work when used from <a href="en/Chrome">chrome</a> in a Gecko application.</p>

<h2 id="Specification">Specification</h2>

<p>DOM Level 0. Not part of specification.</p>

<h2 id="Browser_compatibility">Browser compatibility</h2>



<p>{{Compat("api.Window.getAttention")}}</p>