Mobile-side events

Source: Internet
Author: User

First, Touch

1. Touchstart: Occurs when the finger touches the screen, regardless of the current number of fingers

2, Touchmove: When the finger is sliding on the screen continuously triggered, usually we in the Slide screen page, will call the event preventdefault () can prevent the default, prevent page scrolling

3. Touchend: Triggers when the finger leaves the screen

4. Touchcancel: Triggered when the system stops tracking touch. When I touch, I suddenly call.

Second, the response sequence of touch events

1, Ontouchstart

2, Ontouchmove

3, Ontouchend

4, onclick: 300ms delay on the mobile side, tap: 150ms delay

Third, the Event

1. Originalevent (native event) is a jquery encapsulated event

2. Targettouches the target element of the current touch, returns an array

3, changedtouches all the latest changes on the page touch

4. Touches all touch on the page, if you want to select the first one to use Touches[0]

5, ClientX, Clienty relative to the current screen x or Y position

6, PageX, Pagey relative to the overall page x or Y position

7. Transitionend: Transition End Event

8. Animationend: Animation End Event

Iv. Mobile Event Framework

For example: Zepto, Touch.js, is encapsulated by the native touch event as follows:

1. Swipe: Sliding

2. Swipeleft: Swipe left

3. Swiperight: Swipe Right

4, Swipeup: Swipe up

5, Swipedown: Slide move

6. Doubletap: Double-click

7. Tap

8, Singletap

9, Longtap

Mobile-side events

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.