obj.style.pixelLeft
obj.style.pixelTop

解决方案 »

  1.   

    obj.style.pixelLeft
    obj.style.pixelTop
    obj.style.left
    obj.style.top
      

  2.   

    我试过obj.style.pixelLeft = 0
    obj是一个文本框
      

  3.   

    obj.style.pixelLeft
    obj.style.pixelTop
    obj.style.left
    obj.style.top
    好象只能用在层中。
      

  4.   

    参考这张图,采取层层剥离
    http://msdn.microsoft.com/workshop/graphics/dhtmlpos.gif看看上面那张图,很重要的l=obj.offsetLeft
    whle(obj=obj.parentElement){
        l+=obj.offsetLeft;
    }obj为你要求的元素,top也是一样的求法