JQuery获取touchstart,touchmove,touchend坐标

$('#id').on('touchstart',function(e) {
    var x= e.originalEvent.targetTouches[0].pageX;
    
});

JQuery如上。

document.getElementById("id").addEventListener("touchstart",function(e){
    var _x=e.touches[0].pageX;
    var _y=e.touches[0].pageY;
    console.log("start",_x)
})

原生如上。

一般我们取第一个手指的坐标,如果有其他要求可能 需要判断手指数量

if (e.targetTouches.length == 1){
  //...
}

常用的:

e.preventDefault();

参考来源:http://www.cnblogs.com/luoeeyang/p/4519408.html