--- title: Navigator.maxTouchPoints slug: Web/API/Navigator/maxTouchPoints translation_of: Web/API/Navigator/maxTouchPoints ---
touchPoints = navigator.maxTouchPoints;
if (navigator.maxTouchPoints > 1) { // 浏览器支持多点触控 }
Specification | Status | Comment |
---|---|---|
{{SpecName('Pointer Events 2','#extensions-to-the-navigator-interface', 'maxTouchPoints')}} | {{Spec2('Pointer Events 2')}} | Non-stable version. |
{{SpecName('Pointer Events', '#extensions-to-the-navigator-interface', 'maxTouchPoints')}} | {{Spec2('Pointer Events')}} | Initial definition. |
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatChrome("35")}}[1] | {{CompatGeckoDesktop("29")}}[2] | 10 {{property_prefix("-ms")}} 11 |
{{CompatUnknown}} | {{CompatNo}} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{CompatUnknown}} | {{CompatChrome("35")}}[1] | {{CompatGeckoMobile("29")}}[2] | 10 {{property_prefix("-ms")}} 11 |
{{CompatUnknown}} | {{CompatNo}} |
[1] This was implemented in bug 248918.
[2] Gecko supports this feature behind the preference dom.w3c_pointer_events.enabled
, defaulting to false
.