Touch event types:
There are several types of event that can be fired to indicate that touch-related changes have occurred. You can determine which of these has happened by looking at the event’s TouchEvent.type property.
touchstart: Sent when the user places a touch point on the touch surface. The event’s target will be the element in which the touch occurred.
touchend: Sent when the user removes a touch point from the surface (that is, when they lift a finger or stylus from the surface). This is also sent if the touch point moves off the edge of the surface; for example, if the user’s finger slides off the edge of the screen. The event’s target is the same element that received the touchstart event corresponding to the touch point, even if the touch point has moved outside that element. The touch point (or points) that were removed from the surface can be found in the TouchListspecified by the changedTouches attribute.
touchmove: Sent when the user moves a touch point along the surface. The event’s target is the same element that received the touchstart event corresponding to the touch point, even if the touch point has moved outside that element.
This event is also sent if the values of the radius, rotation angle, or force attributes of a touch point change.
touchenter: Sent when a touch point enters an element. Note: These events don’t bubble.
touchleave: Sent when a touch point exits an element. Note: These events don’t bubble.
touchcancel: Sent when a touch point has been disrupted in some way. There are several possible reasons why this might happen (and the exact reasons will vary from device to device, as well as browser to browser):
- An event of some kind occurred that canceled the touch; this might happen if a modal alert pops up during the interaction.
- The touch point has left the document window and moved into the browser’s UI area, a plug-in, or other external content.
- The user has placed more touch points on the screen than can be supported, in which case the earliest Touch in the TouchList gets canceled.