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 | 草案 | 非稳定版本。 |
| 触摸事件 | 推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
changedTouches
|
Chrome 22 | Edge ≤18 |
Firefox
52
|
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 |
完整支持
不支持
TouchEvent