Skip to content

Commit 1334f95

Browse files
committed
Add a note about document.scrollingElement to readme
1 parent 7138ab1 commit 1334f95

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ var Scrollparent = require("scrollparent");
2222
Scrollparent(document.getElementById("inside-a-scrolling-div")) // HTMLDivElement
2323
```
2424

25+
## Note about the root scrolling element
26+
27+
Internally, the root scrolling element is determined in this library
28+
as the result of
29+
30+
```js
31+
document.scrollingElement || document.htmlElement
32+
```
33+
34+
This should give a usable result in most browsers today
35+
but if you want to ensure full support
36+
you should use a `document.scrollingElement` polyfill such as
37+
[this one](https://github.com/mathiasbynens/document.scrollingElement).
38+
2539
## Contributors
2640

2741
* Ola Holmström (@olahol)

0 commit comments

Comments
 (0)