doScroll method
[IHTMLElement2::doScroll is no longer supported. Starting with Internet Explorer 11, use IHTMLElement2::scrollLeft or IHTMLElement2::scrollTop. For info, see Compatibility changes.]
Simulates a click on a scroll bar component.
Syntax
HRESULT retVal = object.doScroll(component);
Parameters
- component [in, optional]
-
Type: VARIANT
A BSTR that specifies how the object scrolls, using one of the following values.
-
Default. Down scroll arrow is at the specified location.
-
Horizontal scroll thumb or box is at the specified location.
-
Left scroll arrow is at the specified location.
-
Page-down scroll bar shaft is at the specified location.
-
Page-left scroll bar shaft is at the specified location.
-
Page-right scroll bar shaft is at the specified location.
-
Page-up scroll bar shaft is at the specified location.
-
Right scroll arrow is at the specified location.
-
Up scroll arrow is at the specified location.
-
Vertical scroll thumb or box is at the specified location.
-
Composite reference to scrollbarDown.
-
Composite reference to scrollbarLeft.
-
Composite reference to scrollbarPageDown.
-
Composite reference to scrollbarPageLeft.
-
Composite reference to scrollbarPageRight.
-
Composite reference to scrollbarPageUp.
-
Composite reference to scrollbarRight.
-
Composite reference to scrollbarUp.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
There are no standards that apply here.
Remarks
As of Windows Internet Explorer 9, this method is supported only for webpages displayed in IE5 (Quirks) mode. For webpages displayed in standards mode (preferred), use the IHTMLElement2::scrollLeft and IHTMLElement2::scrollTop properties.
The IHTMLElement2::doScroll method is available on all objects, regardless of whether they support scrollbars.
Cascading Style Sheets (CSS) allow you to scroll on all objects through the IHTMLRuleStyle::overflow property.
When the content of an element changes and causes scroll bars to display, the IHTMLElement2::doScroll method might not work correctly immediately following the content update. When this happens, you can use the IHTMLWindow2::setTimeout method to enable the browser to recognize the dynamic changes that affect scrolling.
See also