A polyfill for document.scrollingElement
as defined in the CSSOM specification.
In an HTML document:
<script src="scrollingelement.js"></script>
It’s recommended to place this right before the closing </body>
tag.
The polyfill can be used in frameset
HTML documents (in that case, place the <script>
in the <head>
) or in XML documents as well.
The polyfill has been tested in the following browsers:
- Chrome
- Firefox 3.5+
- Internet Explorer 8+ (but should work even in older versions)
- Opera 11.64+
- Safari 8+ (but should work even in Safari 4)
Thanks to Diego Perini (@diegoperini) for his getScrollingElement
implementation, and for allowing me to re-use it as part of this polyfill.
Thanks to Simon Pieters (@zcorpan) for reviewing the code.
Mathias Bynens |
This project is available under the MIT license.