Add scrollX/scrollY
This commit is contained in:
parent
9e52cf3e14
commit
d8be8b0327
1 changed files with 6 additions and 0 deletions
|
@ -73,6 +73,12 @@ alert('Current scroll from the left: ' + window.pageXOffset);
|
|||
|
||||
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]
|
||||
|
||||
```warn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue