Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. TouchList

TouchList

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

TheTouchList interface represents a list of contact points on a touch surface. For example, if the user has three fingers on the touch surface (such as a screen or trackpad), the correspondingTouchList object would have oneTouch object for each finger, for a total of three entries.

This interface was anattempt to create an unmodifiable list and only continues to be supported to not break code that's already using it. Modern APIs represent list structures using types based on JavaScriptarrays, thus making many array methods available, and at the same time imposing additional semantics on their usage (such as making their items read-only).

These historical reasons do not mean that you as a developer should avoidTouchList. You don't createTouchList objects yourself, but you get them from APIs such asTouchEvent.targetTouches, and these APIs are not deprecated. However, be careful of the semantic differences from a real array.

Instance properties

TouchList.lengthRead only

The number ofTouch objects in theTouchList.

Instance methods

TouchList.item()

Returns theTouch object at the specified index in the list.

Example

See theexample on the main Touch events article.

Specifications

Specification
Touch Events
# touchlist-interface

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp