aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/setcursor/index.html
blob: d87850c4d3099a490b68649722940dc0025657b9 (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
---
title: Window.setCursor()
slug: Web/API/Window/setCursor
translation_of: Web/API/Window/setCursor
---
<div>{{ ApiRef() }}</div>

<div>
<p id="comment_text_2">{{Non-standard_header}}</p>
</div>

<div> </div>

<h2 id="Summary" name="Summary">概要</h2>

<p>在当前窗口中改变光标(鼠标)的样子</p>

<h2 id="Example" name="Example">例子</h2>

<pre class="syntaxbox">function setBusyCursor(enable) {
  window.setCursor(enable ? "wait" : "auto");
}</pre>

<h2 id="Notes" name="Notes">提示</h2>

<p>鼠标样式不会自动重置,需要主动设置回 <code>auto</code> 属性。</p>

<p>这个函数方法是 <a href="/en-US/docs/XPCOM_Interface_Reference/nsIDOMChromeWindow">ChromeWindow interface</a> 的一部分. 这个方法在某些网页上不能用, 可以使用 CSS {{cssxref("cursor")}} 代替.</p>

<h2 id="规范">规范</h2>

<p id="comment_text_2">这不是任何规范的一部分</p>