Skip to content

Commit f47eea7

Browse files
tkrotoffJosh-Cena
andauthored
Improve maxTouchPoints example (mdn#42579)
* Improve maxTouchPoints example * Update files/en-us/web/api/navigator/maxtouchpoints/index.md * Apply suggestion from @Josh-Cena --------- Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
1 parent b666ae2 commit f47eea7

File tree

1 file changed

+8
-2
lines changed
  • files/en-us/web/api/navigator/maxtouchpoints

1 file changed

+8
-2
lines changed

files/en-us/web/api/navigator/maxtouchpoints/index.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ contact points that are supported by the current device.
1616

1717
A number.
1818

19-
## Examples
19+
This value is hardware-dependent. Desktop computers without a touchscreen (Mac, Windows and Linux) return 0 while smartphones (Android and iOS) typically return 5.
20+
21+
## Example
2022

2123
```js
2224
if (navigator.maxTouchPoints > 1) {
23-
// browser supports multi-touch
25+
// Device supports tracking at least 2 touch points; offer complex
26+
// interaction gestures such as swiping with two/three fingers
27+
} else {
28+
// Device only has 1 touch point or is not a touch screen.
29+
// Offer basic gestures such as dragging and clicking
2430
}
2531
```
2632

0 commit comments

Comments
 (0)