Sets or retrieves the distance between the top of the object and the topmost portion of the content currently visible in the window.
HRESULT IHTMLElement2::get_scrollTop(long *p);HRESULT IHTMLElement2::put_scrollTop(long v);
- Pointer to a variable of type long that receives the distance, in pixels.
- long that specifies the distance, in pixels.
Returns S_OK if successful, or an error value otherwise.
This property's value equals the current vertical offset of the content within the scrollable range. Although you can set this property to any value, if you assign a value less than 0, the property is set to 0. If you assign a value greater than the maximum value, the property is set to the maximum value.
This property is always 0 for objects that do not have scroll bars. For these objects, setting the property has no effect.
When a marquee object scrolls horizontally, its IHTMLElement2::scrollTop property is set to 0.
For more information about how to access the dimension and location of elements on the document through the Dynamic HTML (DHTML) Object Model, see Measuring Element Dimension and Location with CSSOM in Internet Explorer 9.