Skip to content

Commit d8be8b0

Browse files
committed
Add scrollX/scrollY
1 parent 9e52cf3 commit d8be8b0

File tree

1 file changed

+6
-0
lines changed
  • 2-ui/1-document/10-size-and-scroll-window

1 file changed

+6
-0
lines changed

2-ui/1-document/10-size-and-scroll-window/article.md

+6
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ alert('Current scroll from the left: ' + window.pageXOffset);
7373
7474
These properties are read-only.
7575
76+
```smart header="Also available as `window` properties `scrollX` and `scrollY`"
77+
For historical reasons, both properties exist, but they are the same:
78+
- `window.pageXOffset` is an alias of `window.scrollX`.
79+
- `window.pageYOffset` is an alias of `window.scrollY`.
80+
```
81+
7682
## Scrolling: scrollTo, scrollBy, scrollIntoView [#window-scroll]
7783
7884
```warn

0 commit comments

Comments
 (0)