|
@@ -113,22 +113,23 @@
|
|
|
|
|
|
function changes() {
|
|
|
elementById.addEventListener('touchstart', function (el) {
|
|
|
- startMouse.x = el.targetTouches[0].pageX;
|
|
|
- startMouse.y = el.targetTouches[0].pageY;
|
|
|
+ // el.preventDefault();
|
|
|
+ let rect = el.target.getBoundingClientRect();
|
|
|
+ startMouse.x = el.touches[0].pageX - rect.left;
|
|
|
+ startMouse.y = el.touches[0].pageY - rect.top;
|
|
|
+ console.log('起点:'+startMouse.x+"终点:"+startMouse.y)
|
|
|
calcStartRadius();
|
|
|
elementById.addEventListener('touchmove', function (e) {
|
|
|
moveMouse.x = startMouse.x;
|
|
|
moveMouse.y = startMouse.y;
|
|
|
startMouse.x = e.pageX - this.offsetLeft;
|
|
|
startMouse.y = e.pageY - this.offsetTop;
|
|
|
- console.log("last_mouse.x="+moveMouse.x);
|
|
|
- console.log("last_mouse.y="+moveMouse.y);
|
|
|
calcEndRadius();
|
|
|
// calcEndAngle();
|
|
|
})
|
|
|
})
|
|
|
elementById.addEventListener('touchend', function () {
|
|
|
- elementById.onmousemove = null;
|
|
|
+ // elementById.removeEventListener('touchmove',this,false);
|
|
|
})
|
|
|
}
|
|
|
|