touchmove Event
Example
Call a function when the user moves the finger over a P element (for touch screens only):
Description
Thetouchmove event occurs whena user moves a finger across the screen.
Thetouchmove event only works on touch screens.
The touchmove event is triggered once for each movement and continues until the finger is released.
Touch Events
| Event | Occurs When |
|---|---|
| touchstart | The user touches an element |
| touchmove | The user moves the finger across the screen |
| touchend | The user removes the finger from an element |
| touchcancel | The touch is interrupted |
Events that are triggered from the user interface belongs to theUiEvent Object.
UiEvent Properties
| Property | Description |
|---|---|
| detail | A number with details about the event |
| view | A reference to the Window object where the event occurred |
See Also:
Syntax
In #"tryit.asp?filename=tryjsref_touchmove_javascript">Try it Yourself »
In JavaScript, using the addEventListener() method:
Technical Details
| Bubbles: | Yes |
|---|---|
| Cancelable: | Yes |
| Event type: | TouchEvent |
| HTML tags: | All HTML elements |
Browser Support
ontouchmove is a DOM Level 4 (2015) feature.
It is supported in all modern browsers:
| Chrome | Edge | Firefox | Safari | Opera |
| Yes | Yes | Yes | Yes | Yes |

