<! DOCTYPE html>
<meta charset= "Utf-8" >
<meta name= "viewport" content= "initial-scale=1.0, maximum-scale=1.0, User-scalable=no"/>
<title></title>
<body>
<div class= "One" >hehehehehehe</div>
<div class= "both" >hahhahhahaha</div>
<script type= "Text/javascript" >
/*
*clientx: Touch the x-coordinate of the target in the viewport.
*clienty: Touch the y-coordinate of the target in the viewport.
*identifier: Identifies the unique ID of the touch.
*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.
*target: The target DOM node of the touch destination.
The *touches:touch object, which contains some coordinate information.
* The Targettouches:touch object, which contains coordinate information, is unclear, if length represents the number of fingers.
* Changedtouches:touch object, contains coordinate information, the situation is unclear.
* */
Monitor finger swipe
Document.addeventlistener (' Touchmove ', function (event) {
var x = Event.touches[0].clientx;
var y = event.touches[0].clienty;
var identifier = Event.touches[0].identifier;
var PageX = Event.touches[0].pagex;
var pagey = Event.touches[0].pagey;
var ScreenX = Event.touches[0].screenx;
var ScreenY = Event.touches[0].screeny;
var target = Event.touches[0].target;
Console.log (X,y,identifier,pagex,pagey,screenx,screeny,target)
Console.log (Event.targetTouches.length)
Console.log (' 2: ', event.changedtouches)
});
Monitor Touch
Document.addeventlistener (' Touchstart ', function (event) {
Alert (1)
//});
Listening Touch End
Document.addeventlistener (' Touchend ', function () {
Alert (3)
// });
</script>
</body>
Mobile-touch events and objects