鼠标位置 
event.x 
event.y 例子:
<script>
var xx=0,yy=0
</script>
<img src="../a.jpg" style='position:absolute;' ondragstart="setCapture();xx=event.x-this.offsetLeft;yy=event.y-this.offsetTop;" ondrag='this.style.left=event.x-xx;this.style.top=event.y-yy' ondragend="releaseCapture();">

解决方案 »

  1.   

    获取event.x,然后减去所在对象的offset,就可以得到鼠标在对象上面的相对位置。
      

  2.   

    x=document.body.scrollLeft+(event.screenX-window.screenLeft)
    y=document.body.scrollTop+(event.screenY-window.screenTop)应该这样来得到鼠标的位置...鼠标的真正的相对于页面的左上0,0坐标的位置是这样的....
    比如X坐标是顶部滚动条偏移位像素加上后面这一段,稀里哗啦..我这样得到的位置,有滚动条也不用怕...
      

  3.   

    http://community.csdn.net/Expert/topic/4249/4249355.xml?temp=4.403323E-02
    http://www.aiiiq.com/tp/js/winmy9c.html
    http://www.aiiiq.com/tp/js/win.html
    http://jkisjk.vip.sina.com/html/MoveTableWithMouse.htm