Mobile-Side Drag events:
Touchstart event: Triggers when the finger touches the screen, even if a finger is already placed on the screen.
Touchmove event: Triggers continuously when the finger is sliding on the screen. During this event, calling the Preventdefault () event can prevent scrolling.
Touchend event: Triggers when the finger is left on the screen.
Touchcancel event: Triggered when the system stops tracking touch.
Call Method:
(1) jquery method: $ (document). Bind ("Touchend", function (e) {});
(2) JavaScript method: Document.addeventlistener ("Touchend", function (e) {});
Get Pagex and Pagey on your phone:
Touchstart event gets: E.originalevent.targettouches[0].pagex.
Touchmove event gets: E.originalevent.targettouches[0].pagex.
Touchend of the event: E.originalevent.changedtouches[0].pagex.
Each Touch object contains the following attributes.
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 destination DOM node targets.
Reasons for invalid phone e.pagex and E.pagey