blob: 01d291f94da5e5af8065aad74e029ee36c4dae10 (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
---
title: 全局事件处理器.onpointerover
slug: Web/API/GlobalEventHandlers/onpointerover
tags:
- HTML DOM
- 全局事件处理器
- 属性
- 引用
- 指针事件
- 文档
translation_of: Web/API/GlobalEventHandlers/onpointerover
---
<div>{{ApiRef("HTML DOM")}}</div>
<p>A {{domxref("GlobalEventHandlers","global event handler")}} for the {{event("pointerover")}} event.</p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox">var <var>overHandler</var> = <var>targetElement</var>.onpointerover;
</pre>
<h3 id="返回值">返回值</h3>
<dl>
<dt><code>overHandler</code></dt>
<dd> pointerover 事件处理器返回目标元素的<code>overHandler.</code></dd>
</dl>
<h2 id="案例">案例</h2>
<p>这里使用两种方式展示了如何去使用 <em>onpointerover</em> 去设置一个元素的 <em>pointerover </em>事件处理器</p>
<pre class="brush: js"><html>
<script>
function overHandler(ev) {
// Process the pointerover event
}
function init() {
var el=document.getElementById("target1");
el.onpointerover = overHandler;
}
</script>
<body onload="init();">
<div id="target1"> Touch me ... </div>
<div id="target2" onpointerover="overHandler(event)"> Touch me ... </div>
</body>
</html>
</pre>
<h2 id="说明">说明</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">说明</th>
<th scope="col">状态</th>
<th scope="col">备注</th>
</tr>
<tr>
<td>{{SpecName('Pointer Events 2','#widl-GlobalEventHandlers-onpointerover', 'onpointerover')}}</td>
<td>{{Spec2('Pointer Events 2')}}</td>
<td>不稳定版本</td>
</tr>
<tr>
<td>{{SpecName('Pointer Events', '#widl-GlobalEventHandlers-onpointerover', 'onpointerover')}}</td>
<td>{{Spec2('Pointer Events')}}</td>
<td>初始定义</td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容性">浏览器兼容性</h2>
<p>{{Compat("api.GlobalEventHandlers.onpointerover")}}</p>
<h2 id="参见">参见</h2>
<ul>
<li>{{event("pointerover")}}</li>
</ul>
|