<img src="images/a.gif" onclick="GetPosition(event)" />
<script>
function GetPostion(e) {
var x = getX(e);
var y = getY(e);
}
function getX(e) {
e = e || window.event;
return e.pageX || e.clientX + document.body.scroolLeft;
}
function getY(e) {
e = e|| window.event;
return e.pageY || e.clientY + document.boyd.scrollTop;
}
</script>
function mouseMove(ev) { ev2 = ev || window.event; mousePos = mouseCoords(ev2);
}
function mouseCoords(ev) { if (ev.pageX || ev.pageY) { return { x: ev.pageX, y: ev.pageY }; } try{ //IE6下,在开窗中再打开设置窗,显示错误,但不影响功能。 return { x: ev.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft), y: ev.clientY + (document.documentElement.scrollTop || document.body.scrollTop) }; }catch(e){}
}
var aListSetMoving = new aListSetMove();//创建移动层的实例
var mousePos; document.Onmousemove = mouseMove;