Posted in Javascript onAugust 05, 2013
var xPos; var yPos; document.onmousemove = mouseMove; function mouseMove(ev) { ev = ev window.event; var mousePos = mouseCoords(ev); xPos = mousePos.x; yPos = mousePos.y; } function mouseCoords(ev) { if (ev.pageX ev.pageY) { return { x: ev.pageX, y: ev.pageY }; } return { x:ev.clientX+document.body.scrollLeft+document.documentElement.scrollLeft, y:ev.clientY + document.body.scrollTop + document.documentElement.scrollTop }; }
javascript获取鼠标位置部分的实例代码(兼容IE,FF)
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@