这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
Touch.identifier
returns a value uniquely identifying this point of contact with the touch surface. This value remains consistent for every event involving this finger's (or stylus's) movement on the surface until it is lifted off the surface.
touchItem.identifier;
A
long
that represents the unique ID of the
触摸
对象。
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 | 草案 | 无变化。 |
| 触摸事件 | 推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
标识符
|
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 |
完整支持
不支持
见实现注意事项。