//获取鼠标悬浮位置的坐标 function mousePosition(e) { var x = ""; var y = ""; if(e.pageX && e.pageY) { x = e.pageX; y= e.pageY; } var scrollElem = (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body; x = e.clientX + scrollElem.scrollLeft; y= e.clientY + scrollElem.scrollTop; }
这段时间再弄悬浮框,很简单的效果,记录下,防止忘记