Add scrollX/scrollY

This commit is contained in:
Ilya Kantor 2021-04-15 09:45:19 +03:00
parent 9e52cf3e14
commit d8be8b0327

View file

@ -73,6 +73,12 @@ alert('Current scroll from the left: ' + window.pageXOffset);
These properties are read-only. These properties are read-only.
```smart header="Also available as `window` properties `scrollX` and `scrollY`"
For historical reasons, both properties exist, but they are the same:
- `window.pageXOffset` is an alias of `window.scrollX`.
- `window.pageYOffset` is an alias of `window.scrollY`.
```
## Scrolling: scrollTo, scrollBy, scrollIntoView [#window-scroll] ## Scrolling: scrollTo, scrollBy, scrollIntoView [#window-scroll]
```warn ```warn