scrollparent.js
A function to get the scrolling parent of an html element.
Install
npm install scrollparent --save
Example
var Scrollparent = ; // HTMLHtmlElement or HTMLBodyElement as appropriate
var Scrollparent = ; // HTMLDivElement
Note about the root scrolling element
Internally, the root scrolling element is determined in this library as the result of
documentscrollingElement || documentdocumentElement;
This should give a usable result in most browsers today
but if you want to ensure full support
you should use a document.scrollingElement
polyfill such as
this one.
Contributors
- Ola Holmström (@olahol)
- Bart Nagel (@tremby)
- Daniel White (@danbrianwhite)
License
MIT