touchstart
Commons
stable
Handle the `touchstart` phase of a gesture: record the starting X/Y coordinates from the first changed touch point and call the optional `start` callback on the wrapper.
API
Signature
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- eventrequisTouchEvent
- The native TouchEvent fired by the browser. `changedTouches[0]` is used to read the initial position.
- wrapperrequisTTouchWrapper
- The shared gesture state object. `touchstartX` and `touchstartY` are written, and `wrapper.start` is called when defined.
API
Valeur de retour
La valeur retournée par cet util.
- Side-effectful — mutates the wrapper and calls the optional callback. Returns nothing.
Usage
Exemples
Extraits de code prêts à coller.
Pair with touchend to detect a swipe