相对文档获得鼠标坐标;
function getMouse(ev){ var ev = ev || event; var scrollLeft = document.documentElement.scrollLeft||document.body.scrollLeft; var scrollTop = document.documentElement.scrollTop||document.body.scrollTop; return {x:scrollLeft+ev.clientX, y:scrollTop+ev.clientY}; }