parseInt(div1.style.left)
parseInt(div1.style.top)

解决方案 »

  1.   

    <script>
    var xx=0,yy=0
    </script>
    <img src="http://free.cnyys.com/my/killerj/new/images/me.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();woyingjie(this.style.left,this.style.top)"><script>
    function woyingjie(x,y){
    var o=document.form1;
    o.x.value=x;
    o.y.value=y;
    o.submit();
    }
    </script><form name=form1>
     <input type=hidden name=x>
     <input type=hidden name=y>
    </form>
     
      

  2.   

    parseInt(div1.style.left) => obj.pixelLeft
      

  3.   

    谢谢各位的回复,我想做的效果是:http://free.cnyys.com/my/test123/test.html
    把三个小图标随便拖拉后,能够通过按保存按钮保存其最后坐标值(小图标的位置在保存后不能再移动),现在我不知怎样取得小图标拖拉后的最后坐标值,
    小图标1拖拉后:坐标left=?  top=?
    小图标2拖拉后:坐标left=?  top=?
    小图标3拖拉后:坐标left=?  top=?
    这三组值怎样在页面显示出来
    谢谢!