Document: createTouchList() メソッド

非推奨;: この機能は非推奨になりました。まだ対応しているブラウザーがあるかもしれませんが、すでに関連するウェブ標準から削除されているか、削除の手続き中であるか、互換性のためだけに残されている可能性があります。使用を避け、できれば既存のコードは更新してください。このページの下部にある互換性一覧表を見て判断してください。この機能は突然動作しなくなる可能性があることに注意してください。

非標準: この機能は標準ではなく、標準化の予定もありません。公開されているウェブサイトには使用しないでください。ユーザーによっては使用できないことがあります。実装ごとに大きな差があることもあり、将来は振る舞いが変わるかもしれません。

Document.createTouchList() メソッドは、新しい TouchList オブジェクトを生成して返します。

構文

js
createTouchList(touch1)
createTouchList(touch1, touch2)
createTouchList(touch1, touch2, /* …, */ touchN)

引数

touch1, …, touchN

0 個以上の Touch オブジェクトです。 メモ: Firefox は Touch オブジェクトの配列も受け付けます。

返値

list

TouchList オブジェクトで、 touches 引数で指定された Touch オブジェクトを含みます。

この例は、 Document.createTouchList() メソッドを使用して TouchList オブジェクトを生成する様子を紹介しています。

以下のコードスニペットでは、いくつかの Touch オブジェクトがタッチ点と共に target 要素に生成され、 TouchList オブジェクトを作成するために使用されます。

js
const target = document.getElementById("target");

// Create some touch points
const touch1 = document.createTouch(window, target, 1, 15, 20, 35, 40);
const touch2 = document.createTouch(window, target, 2, 25, 30, 45, 50);

// Create an empty TouchList objects
const list0 = document.createTouchList();

// Create a TouchList with only one Touch object
const list1 = document.createTouchList(touch1);

// Create a list with two Touch objects
const list2 = document.createTouchList(touch1, touch2);

仕様書

この機能は、現在のどの仕様にも属しません。標準化の予定はなくなりました。

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
createTouchList
DeprecatedNon-standard

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.

関連情報