兼容获取鼠标在整个页面的坐标;
document.onclick = function () {
//
//鼠标在整个页面上的坐标 = 鼠标在浏览器可是区域的坐标
//+页面被卷曲的部分;
var y = event.pageY || event.clientY + scroll().top;
var x = event.pageX || event.clientX + scroll().left;
}
function scroll(){//被卷曲的头部和左部;
return{
"top":window.pageYOffset || document.documentElement.scrollTop,
"left":window.pageXOffset || document.documentElement.scrollLeft
}
}
if(you love javascript) I'd like to be with your friends