touchmove Event
Example
Execute a JavaScript when the user moves the finger over a P element (for touch screens only):
<p ontouchmove="myFunction(event)">Touch me!</p>
Try it Yourself »
Definition and Usage
The touchmove event occurs when the user moves the finger across the screen.
The touchmove event will be triggered once for each movement, and will continue to be triggered until the finger is released.
Note: The touchmove event will only work on devices with a touch screen.
Tip: Other events related to the touchmove event are:
- touchstart - occurs when the user touches the screen
- touchend - occurs when the user removes the finger from an element
- touchcancel - occurs when the touch is interrupted
Browser Support
The numbers in the table specify the first browser version that fully supports the event.
Event | |||||
---|---|---|---|---|---|
touchmove | 22.0 | 12.0 | 52 | Not supported | Not supported |
Syntax
In JavaScript, using the addEventListener() method:
object.addEventListener("touchmove", myScript);
Try it Yourself »
Technical Details
Bubbles: | Yes |
---|---|
Cancelable: | Yes |
Event type: | TouchEvent |
Supported HTML tags: | All HTML elements |