Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

pageXOffset property

Gets the distance, in pixels, that a document has scrolled horizontally.

Syntax

JavaScript

p = object.pageXOffset

 

Property values

Type: Integer

The distance the document has been scrolled.

Standards information

Remarks

When you scroll a document horizontally, some content is moved outside the view of the display area. The pageXOffset property returns the difference between the first pixel in the content and the first pixel currently in view.

The value of the pageXOffset property is negative when the base direction of a document is set to display content in right-to-left order. For more information, see W3C Tutorial: Creating HTML Pages in Arabic, Hebrew and Other Right-to-left Scripts.

See also

window
pageYOffset

 

 

Show:
© 2015 Microsoft