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