1. Introduction to Touch Events
The Ontouchstart, Ontouchmove, Ontouchend, Ontouchcancel events are generated when the Web page on the mobile terminal touches the screen, respectively, corresponding to the touch screen start, drag and Finish touch screen event and cancel.
Triggers the ontouchstart when the finger is pressed.
Triggers the ontouchmove when the finger is moved.
Triggers the ontouchend when the finger is removed.
When some higher-level events occur (such as phone access or pop-up messages), the current touch operation is triggered, triggering ontouchcancel. (You can usually pause the game, archive, and so on when Ontouchcancel.) )
2. The relationship between touch events and mouse events
After a touch-screen operation, the moment the finger is lifted (i.e. after ontouchend), the system will determine whether the content of the element receiving the event has been altered. If the content is changed, the next events will not be triggered, and if there is no change, the event will be triggered in the order of Mousedown,mouseup,click.
3. Gesture Events
Gesture events, including finger tapping (click), Flick (flick), double-click (double-click), Finger separation, closing (scale), turning (rotate), everything the finger can do on the screen, It is triggered only when there are two or more fingers on the screen, and the event handler is given a gestureevent type parameter that contains information about the scale of the finger (the proportion that is separated during the two movement) and the rotation (the angle of rotation between two fingers). This event is a higher-level package for the touch event, and as with touch, it also includes Gesturestart,gesturechange,gestureend.
Gesture Event Triggering process:
Step 1, first finger down, trigger Touchstart
Step 2, second finger down, trigger Gesturestart
Step 3, trigger the touchstart of the second finger
Step 4, Trigger Gesturechange immediately
Step 5, Finger movement, continuous trigger gesturechange, as the mouse moves on the screen when the trigger MouseMove like
Step 6, second finger lift, trigger gestureend, will no longer trigger Gesturechange
Step 7, trigger the touchend of the second finger
Step 8, Trigger touchstart! Note that multiple fingers on the screen, lifting a root, will refresh the global touch! Re-trigger the touchstart of the first finger
Step 9, lift the first finger and trigger the Touchend
Mobile-Touch Events Ontouchstart, Ontouchmove, Ontouchend, Ontouchcancel