pointermove event is fired when a pointer changes coordinates, and the pointer has not been canceled by a browser touch-action .

冒泡 Yes
可取消 Yes
接口 PointerEvent
事件处理程序特性 onpointermove

用法注意事项

The event, which is of type PointerEvent , provides all the information you need to know about the user's interaction with the pointing device, including the position, movement distance, button states, and much more.

范例

To add a handler for pointermove events using addEventListener() :

const para = document.querySelector('p');
para.addEventListener('pointermove', (event) => {
  console.log('Pointer moved');
});
					

还可以使用 onpointermove 事件处理程序特性:

const para = document.querySelector('p');
para.onpointermove = (event) => {
  console.log('Pointer moved');
};
					

规范

规范 状态
指针事件 过时

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
pointermove event Chrome 55 Edge 12
12
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: mspointermove
Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE 11
11
10 Alternate Name
Alternate Name Uses the non-standard name: mspointermove
Opera ? Safari No WebView Android 55 Chrome Android 55 Firefox Android 29 Opera Android ? Safari iOS No Samsung Internet Android 6.0

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

用户必须明确启用此特征。

用户必须明确启用此特征。

使用非标名称。

另请参阅

Internet Explorer also used to support an event named MSPointerHover , which fired when a contact (normally a pen) moves over an element without touching the surface. This proprietary method is specific to Internet Explorer and, as of Internet Explorer 11, has been deprecated. Starting with IE11 the pointermove event will fire for all pen movement (regardless if its hovering or not).

元数据

  • 最后修改: