Mobile Web Development---the next day

Source: Internet
Author: User

First, touch events
Touchstart: Triggers when the finger touches the screen
How to bind an event: Dom.addeventlistener ("Touchstart", function (e) {});
The E object returned by the event contains properties that are specific to the mobile side:
Targettouches all current touches of the target element
Changedtouches? All the latest changes to the touch on the page
Touches all touches on the page
Touchmove: Continuous trigger when finger is sliding on screen
How to bind an event: Dom.addeventlistener ("Touchmove", function (e) {});
The E object returned by the event contains properties that are specific to the mobile side:
Originalevent? is a jquery encapsulated event.
Targettouches all current touches of the target element
Changedtouches? All the latest changes to the touch on the page
Touches all touches on the page

When sliding, the picture box is constantly positioned to achieve a sliding effect.
Positioning position, current picture positioning plus moving distance
When you start sliding, you need to clear the timer, move the time to clear the transition,-index*width + Distancex
Touchend: Triggers when the finger ends sliding on the screen
How to bind an event: Dom.addeventlistener ("Touchend", function (e) {});
The E object returned by the event contains properties that are specific to the mobile side:
Changedtouches? All the latest changes to the touch on the page
Touchcancel: The system stops tracking when the touch is triggered and the system is passively terminated, such as alert.
Note: The event will only be logged when Touchend events changedtouches
ClientX: Touch the x-coordinate of the target in the viewport.
ClientY: Touch the y-coordinate of the target in the viewport.
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.
Second, transition and animation end time
1, Transitionend: Trigger After the end of the transition.
How to bind an event:
Dom.addeventlistener ("Webkittransitionend", function (e) {});
Dom.addeventlistener ("Transitionend", function (e) {});
2, Animationend: Triggered after the end of the animation.
How to bind an event:
Dom.addeventlistener ("Webkitanimationend", function (e) {});
Dom.addeventlistener ("Animationend", function (e) {});
3. Gesture Events
Gesturestart: Triggers when a finger touches the screen and the second finger touches the screen again.
Gesturechange: Triggered immediately after the above event is triggered.
Gestureend: Triggers when the second finger leaves the screen and will not trigger gesturechange again.
The other two parameters are returned in the event
Scale initial 1 based on the sliding distance of two fingers
Rotation rotation angle calculated based on the sliding distance of two fingers initial 0
4. Full Screen single page layout: html,body{height:100%}

Mobile Web Development---the next day

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.