pixelLeftSets or retrieves the left position of the element, in pixels. Unlike the left property, this property's value is an integer, not a string, and is always interpreted in pixels. scrollLeftSets or retrieves the distance, in pixels, between the left edge of the element and the leftmost portion of the element that is currently visible in the window. This is equal to the horizontal distance that the content of the element has been scrolled. 

解决方案 »

  1.   

    scrollLeft:水平滚动条的总长度(可见部分+不可见部分)
    pixelLeft:相对于某点(一般是屏幕左上角)的水平距离。
      

  2.   

    不对吧,scroll好象是一个对象的客户区的最左边啊!
      

  3.   

    心云意水的解释可能有问题。
    根据我上面从HTMLREF.CHM里面摘抄的解释,scrollLeft应该是水平滚动条已经滚动的距离(元素左边界与可见部分的最左边的横坐标差),而不是总长度。
    水平滚动条总长度应该是scrollWidth才对。
      

  4.   

    属性图解http://msdn.microsoft.com/workshop/graphics/dhtmlpos.gif
      

  5.   

    http://msdn.microsoft.com/workshop/author/om/measuring.asp属性图解
      

  6.   

    啊!sorry!
    我检讨~~~
    scrollTop:垂直滚动条已经滚动的距离
    scrollHeight:垂直滚动条总长度
    scrollLeft:水平滚动条已经滚动的距离
    scrollWeight:水平滚动条总长度当时没看清楚,sorry~~
    多谢Estyle(靳田)提醒!
      

  7.   

    用这段代码试试就知道啦
    <form name="form1" method="post" action="">
      <div align="center">
        <textarea name="textarea" rows="10"></textarea>
        <br>
        <input type="button" name="button" value="按钮" onclick="alert(textarea.scrollTop);">
      </div>
    </form>先直接按一下,按扭,然后再添加n行文字,使scroll出来,然后滚动一下scroll再按按钮,现在你肯定已经明白了!