//获取鼠标坐标
var startPoint = [];
var endPoint = [];
var movePoint = [];
function getMousePos(event, point) {
var a = [],
e = event || window.event,
scrollX = document.documentElement.scrollLeft || document.body.scrollLeft,
scrollY = document.documentElement.scrollTop || document.body.scrollTop,
x = e.pageX || e.clientX + scrollX,
y = e.pageY || e.clientY + scrollY;
//alert('x: ' + x + '\ny: ' + y);
if (point == "startPoint") {
startPoint = [x, y]
} else if (point == "endPoint") {
endPoint = [x, y]
} else if (point == "movePoint") {
movePoint = [x, y]
}
a = [x, y];
return a;
};
在PC端没有问题,iphone也没问题,
在安卓上就获取不到X\Y的值了,
求指导~
var startPoint = [];
var endPoint = [];
var movePoint = [];
function getMousePos(event, point) {
var a = [],
e = event || window.event,
scrollX = document.documentElement.scrollLeft || document.body.scrollLeft,
scrollY = document.documentElement.scrollTop || document.body.scrollTop,
x = e.pageX || e.clientX + scrollX,
y = e.pageY || e.clientY + scrollY;
//alert('x: ' + x + '\ny: ' + y);
if (point == "startPoint") {
startPoint = [x, y]
} else if (point == "endPoint") {
endPoint = [x, y]
} else if (point == "movePoint") {
movePoint = [x, y]
}
a = [x, y];
return a;
};
在PC端没有问题,iphone也没问题,
在安卓上就获取不到X\Y的值了,
求指导~