js--multi-touch Web front-end development in the fingertip: dealing with complex gestures __c#

Source: Internet
Author: User

Reprint Address: http://www.cnblogs.com/pifoo/archive/2011/05/22/webkit-touch-event-3.html


This article focuses on the gesture event (Android and iOS) that are unique to the multiple-touch devices. This one
The event is a higher-level package for the touch event, and like a touch, it also includes Gesturestart,gesturechange,
Gestureend Three event callbacks:
?

Gesturestart///When two or more fingers are placed on the screen to trigger the Gesturechange//when there are two or more fingers on the screen, and when the fingers are moving, trigger the gestureend//when the last second finger is lifted, the end of G Esture

An gestureevent type parameter is obtained in the event handler, which contains the scale of the finger (the proportion of the two root movement separated
Information and rotation (the angle of the line rotation between the two fingers).
When two or more fingers are active on the screen, we can make some more complex gestures. It's going to involve ordinary mouse.
Pieces, touch events and gesture events are more complex. Touch has been described in detail in the first article, and here it is easy to carry.
Let's take a look at what happens when you put two fingers on the screen separately:
1, the first finger down, triggering touchstart, nothing else will happen (please refer to the second article, the finger lift will trigger
The events of the mouse)
2, the second finger down, triggering gesturestart
3, trigger the second finger of the Touchstart
4, immediately trigger Gesturechange
5, the finger moves, continues to trigger the gesturechange, just like the mouse when moving on the screen to trigger MouseMove
6, the second finger lift, trigger gestureend, will not trigger Gesturechange
7, trigger the second finger of the touchend
8, triggering touchstart. Note, as described in the first article, multiple fingers on the screen, lifting one, will refresh the global
Touch. The touchstart that triggers the first finger is different from what Apple describes on the official website.
9, lift the first finger, trigger touchend
The handling of gesture events is similar to the touch, and we usually use the information in the Gestureevent object in Gesturechange to
Do some things:
?
var angle = event.rotation; Var

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.