Mobile-commonly used touch events and common coordinates

Source: Internet
Author: User

First, touch events

Basic events:

Touchstart//trigger when finger just touches the screen

Touchmove//trigger when the finger moves on the screen

Touchend//trigger when the finger moves away from the screen

Here's less of a comparison:

Trigger when touchcancel//touch process is canceled by the system

Each event has the following list, such as Touchend's targettouches of course 0:

Touches//List of all fingers on the screen

Targettouches//List of all fingers located on this element

Changedtouches//List of all fingers involved in the current event

Each event has a list, and each list has the following properties:

Copy Code

Where coordinates are commonly used Pagex,pagey:

PageX//Relative to the X-coordinate of the page

Pagey//Relative to the Y-coordinate of the page

ClientX//X-coordinate relative to viewport

ClientY//Y coordinate relative to the viewport

ScreenX//Relative to the X-coordinate of the screen

ScreenY//Relative to the Y-coordinate of the screen

Identifier//Unique number of the current touch point

Target//The DOM element that the finger touches

Other related events:

Event.preventdefault ()//block browser zoom, scroll bar scrolling when touch is blocked

var Supporttouch = "Createtouch" in document//To determine if touch events are supported

Mobile-commonly used touch events and common coordinates

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.