Skip to content

Commit 07a22fc

Browse files
committed
Fix #2079 - Remove 'elem' from elem.scrollLeft/scrollTop
1 parent 6683781 commit 07a22fc

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ Why so? Better don't ask. These inconsistencies come from ancient times, not a "
6060
6161
## Get the current scroll [#page-scroll]
6262
63-
DOM elements have their current scroll state in `elem.scrollLeft/scrollTop`.
63+
DOM elements have their current scroll state in their `scrollLeft/scrollTop` properties.
6464
65-
For document scroll `document.documentElement.scrollLeft/Top` works in most browsers, except older WebKit-based ones, like Safari (bug [5991](https://bugs.webkit.org/show_bug.cgi?id=5991)), where we should use `document.body` instead of `document.documentElement`.
65+
For document scroll, `document.documentElement.scrollLeft/Top` works in most browsers, except older WebKit-based ones, like Safari (bug [5991](https://bugs.webkit.org/show_bug.cgi?id=5991)), where we should use `document.body` instead of `document.documentElement`.
6666
67-
Luckily, we don't have to remember these peculiarities at all, because the scroll is available in the special properties `window.pageXOffset/pageYOffset`:
67+
Luckily, we don't have to remember these peculiarities at all, because the scroll is available in the special properties, `window.pageXOffset/pageYOffset`:
6868
6969
```js run
7070
alert('Current scroll from the top: ' + window.pageYOffset);

0 commit comments

Comments
 (0)