我已经编写了onmousemove事件在Firefox和IE中运行良好但不在Chrome中的代码:
var mouse;
function storeMouse(e) {
if (!e) e = window.event;
mouse = { clientX: e.clientX, clientX: e.clientY };
}
function test(e) {
alert(mouse.clientX);
if (mouse.clientX < 150) {
var agree = confirm("Are you sure to leave this page");
if (!agree) {
return false;
}
else {
}
}
}
答案 0 :(得分:2)
第4行的问题:重复mouse.clientX