offsetx:Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event.

解决方案 »

  1.   

    screenX:Retrieves the x-coordinate of the mouse pointer's position relative to the user's screen. 
    clientX:Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.
    x,y分别是x,y轴方向。
      

  2.   

    offsetx:设置或者是得到鼠标相对于目标事件在x坐标上的位置。
    screenX:相对于用户屏幕。
    clientX:相对于客户区域的x坐标位置,不包括滚动条,就是正文区域。