Touch: identifier プロパティ
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Touch.identifier
はタッチ面に接触した点を識別する固有の値を返します。この値は、タッチ面上でのこの指(またはスタイラス)の動きに関わるすべてのイベントに対して、タッチ面から離れるまで一貫したものです。
値
long
で、 Touch
オブジェクトの固有の ID を表します。
例
js
someElement.addEventListener(
"touchmove",
(e) => {
// 最後のイベント以降に変更されたタッチ点のリストを反復処理し、
// 各タッチ点の識別子を出力する。
for (let i = 0; i < e.changedTouches.length; i++) {
console.log(
`changedTouches[${i}].identifier = ${e.changedTouches[i].identifier}`,
);
}
},
false,
);
仕様書
Specification |
---|
Touch Events # dom-touch-identifier |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
identifier |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- No support
- No support
- Has more compatibility info.
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.