changedTouches read-only property is a TouchList whose touch points ( 触摸 objects) varies depending on the event type, as follows:

  • 对于 touchstart event, it is a list of the touch points that became active with the current event.
  • 对于 touchmove event, it is a list of the touch points that have changed since the last event.
  • 对于 touchend event, it is a list of the touch points that have been removed from the surface (that is, the set of touch points corresponding to fingers no longer touching the surface).

句法

var changes = touchEvent.changedTouches;
					

返回值

changes
TouchList whose 触摸 objects include all the touch points that contributed to this touch event.

范例

This example illustrates the TouchEvent 对象的 TouchEvent.changedTouches property. The TouchEvent.changedTouches 特性为 TouchList object that contains one 触摸 object for each touch point which contributed to the event.

In following code snippet, the touchmove event handler iterates through the changedTouches list and prints the identifier of each touch point that changed since the last event.

someElement.addEventListener('touchmove', function(e) {
   // Iterate through the list of touch points that changed
   // since the last event and print each touch point's identifier.
   for (var i=0; i < e.changedTouches.length; i++) {
     console.log("changedTouches[" + i + "].identifier = " + e.changedTouches[i].identifier);
   }
}, false);
					

规范

规范 状态 注释
Touch Events – Level 2 草案 非稳定版本。
触摸事件 推荐 初始定义。

浏览器兼容性

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
changedTouches Chrome 22 Edge ≤18 Firefox 52
52
不支持 18 — 24
IE No Opera Yes Safari No WebView Android Yes Chrome Android Yes Firefox Android 6 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

元数据

  • 最后修改: