One, support WebKit's Touch event
The Web page mouse on the PC generates the Ontouchstart, Ontouchmove, Ontouchend, ontouchcancel events that generate the iphone, ipod Touch, and the Web page touch screen on the ipad, respectively, corresponding to the start of the touch screen, Drag and drop and complete touch-screen events and cancellations.
1,Touchstart--occurs when the finger touches the screen. No matter how many fingers are present
2.Touchmove-When the finger is sliding on the screen, it is triggered continuously. Usually we slide the page again, and the Preventdefault () that invokes the event can prevent the default from happening: Prevent page scrolling
3.Touchend-triggers when the finger leaves the screen
4,touchcancel--The system stops tracking touch when it will trigger. For example, in the process of touching a sudden page alert () A prompt box, which will trigger the event, this event is less used
Second, each touch event includes three touch lists
1. Touches: A list of all the fingers that are currently on the screen.
2. Targettouches: A list of the fingers that are located on the current DOM element.
3. Changedtouches: A list of fingers that involve the current event.
These lists are made up of objects that contain touch information
1. Identifier: A numeric value that uniquely identifies the current finger in a touch session.
2, Target:dom elements, is the target of the action.
3. Customer/page/screen coordinates: The position where the action takes place on the screen.
4. Radius coordinates and RotationAngle: Draw roughly the shape of a finger oval.
Iv. the relationship between touch events and mouse events
After the 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 changed, if the content is changed, the next event will not be triggered, if not changed, will follow the Mousedown,mouseup, The Click order triggers the event. In particular, the Mouseout event of the previous event is triggered only if a touch-screen event is triggered again.
V. Support for Winphone 8 touch events
1. mspointerdown--occurs when the finger touches the screen. No matter how many fingers are present
2. mspointermove--is triggered continuously when the finger is sliding on the screen. Usually we slide the screen again, will call the CSS Html{-ms-touch-action:none;} You can prevent the default from happening: Prevent page scrolling
3. mspointerup--triggers when the finger leaves the screen
Reference: Mobile-Touch Event http://www.studyofnet.com/news/849.html
This article is from the "Learning also leisure" blog, please be sure to keep this source http://studyofnet.blog.51cto.com/8142094/1681531
Use of mobile touch events