js移动端拖拽事件写法

let show_img = document.getElementById("showImg_div");
show_img.addEventListener("touchstart",function (ev){
start_x = ev.touches[0].clientX;
})

但是touchend 中ev时没有touches[0]的,其长度是0  结束点的坐标在

changedTouches

猜你喜欢

转载自blog.csdn.net/qq_32307891/article/details/86522920