GlobalEventHandlers.onpointermove

一个global event handler(全局事件) pointermove 事件.

语法

var moveHandler = targetElement.onpointermove;

返回值

moveHandler
返回 targetElement 元素的pointermove事件处理函数.

示例

下面展示了两种设置元素pointermove事件处理函数的方法.

<html>
<script>
function moveHandler(ev) {
 // 此处添加事件处理语句
}
function init() {
 var el=document.getElementById("target1");
 el.onpointermove = moveHandler;
}
</script>
<body onload="init();">
<div id="target1"> Touch me ... </div>
<div id="target2" onpointermove="moveHandler(event)"> Touch me ... </div>
</body>
</html>

规范

Specification Status Comment
Pointer Events – Level 2
onpointermove
Working Draft Non-stable version
Pointer Events
onpointermove
Recommendation Initial definition

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 35[1] 59 (59) 10 -ms
11
? 未实现
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 35[1] 29.0 (29)[2] 10 -ms
11
? 未实现

[1] This was implemented in bug 248918.

[2] Supported behind the preference dom.w3c_pointer_events.enabled, defaulting to false.

相关链接