--- title: TouchList slug: Web/API/TouchList translation_of: Web/API/TouchList ---

{{ APIRef("Touch Events") }}

TouchList 介面表示了一個觸控平面上所有觸碰點的列表;舉例來說,假如使用者有三隻手指於觸控平面(如觸控螢幕或是觸控板)上,則其相對應的 TouchList 物件中就會分別有三個 {{domxref("Touch")}} 物件各代表一個手指的觸碰。

屬性

{{domxref("TouchList.length")}} {{readonlyInline}}
The number of {{domxref("Touch")}} objects in the TouchList.

方法

{{domxref("TouchList.identifiedTouch()")}} {{obsolete_inline}}
Returns the first {{domxref("Touch")}} item in the list whose identifier matches a specified value.
{{domxref("TouchList.item()")}}
Returns the {{domxref("Touch")}} object at the specified index in the list.

範例

See the example on the main Touch events article.

規範

Specification Status Comment
{{SpecName('Touch Events 2','#touchlist-interface')}} {{Spec2('Touch Events 2')}} Non-stable version.
{{SpecName('Touch Events', '#touchlist-interface')}} {{Spec2('Touch Events')}} Initial definition.

瀏覽器相容性

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support {{CompatChrome("22.0")}} {{CompatGeckoDesktop("18.0")}}[1]
{{CompatGeckoDesktop("52.0")}}[2]
{{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Android Webview Chrome for Android Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatGeckoMobile("6.0")}} {{CompatVersionUnknown}} 11 {{CompatVersionUnknown}} {{CompatVersionUnknown}}

[1] Touch events were implemented in Gecko 18.0, but removed again in 24.0 {{geckoRelease("24.0")}} on the desktop version of Firefox due to web compatibility issues ({{bug(888304)}}).

[2] As of Gecko 52.0, touch events support has been fixed and reenabled in Windows desktop platforms.

參見