In the mobile page development, often use touch events, such as left-sliding right-side carousel. Common touch events are touchstart , touchmovetouchend。
Each event contains the following three properties for tracking the Tiger touch:
Touches: Represents an array of touch objects that are currently tracked by touching operations.
Targettouches: An array of touch objects that are specific to the event target.
Changetouches: An array of touch objects that represent what has changed since the last touch.
Each touch event contains the following properties:
ClientX: Touch the x-coordinate of the target in the viewport.
ClientY: Touch the y-coordinate of the target in the viewport.
Identifier: Identifies the unique ID of the touch.
PageX: Touch the x-coordinate of the target in the page.
Pagey: Touch the y-coordinate of the target in the page.
ScreenX: Touch the x-coordinate of the target in the screen.
ScreenY: Touch the y-coordinate of the target in the screen.
Target: Touch the DOM node destination.
For example:
$ (document). On (' Touchstart ', function (e) {
Alert ("Start sliding (" + E.touches[0].clientx + "," + E.touches[0].clienty + ")")
});
$ (document). On (' Touchmove ', function (e) {
Alert ("Swipe in (" + E.changetouches[0].clientx + "," + E.changetouches[0].clienty + ")")
});
$ (document). On (' Touchend ', function (e) {
Alert ("Swipe end (" + E.touches[0].clientx + "," + E.touches[0].clienty + ")")
})
Mobile-Touch Events