Collapse the table of content
Expand the table of content

onscroll event

Fires when the user repositions the scroll box in the scroll bar on the object.


HTML Attribute <element onscroll = "handler(event)">
Event Property object.onscroll = handler;
attachEvent Method object.attachEvent("onscroll", handler)
addEventListener Method object.addEventListener("scroll", handler, useCapture)


Event information



Event handler parameters

pEvtObj [in]

Type: IHTMLEventObj

Standards information

There are no standards that apply here.


Use the IHTMLElement2::componentFromPoint and IHTMLElement2::doScroll methods to control the scroll bar components.

Cascading style sheets (CSS) enable scrolling on all objects through the IHTMLRuleStyle::overflow property. These objects are not listed in the Applies To list for this event.

Scrolls the contents of an object until new portions of the object become visible.

To invoke this event, do one of the following:

  • Click and drag the scroll box with the mouse.
  • Click the scroll arrow.
  • Click the scroll bar.
  • Invoke the IHTMLElement2::doScroll method.
  • Press the HOME or END key
  • Press the SPACEBAR key.
  • Press the PAGE UP or PAGE DOWN key.
  • Press the ARROW UP or ARROW DOWN key until scrolling occurs.

The pEvtObj parameter is required for the following interfaces:

See also




Community Additions

© 2015 Microsoft