Mohammad Asif cf937194cb Removed un-waned things 1. | 5 kuukautta sitten | |
---|---|---|
.. | ||
LICENSE | 5 kuukautta sitten | |
README.md | 5 kuukautta sitten | |
package.json | 5 kuukautta sitten | |
scrollparent.js | 5 kuukautta sitten |
A function to get the scrolling parent of a html element.
npm install scrollparent --save
var Scrollparent = require("scrollparent");
Scrollparent(document.getElementById("content")) // HTMLHtmlElement or HTMLBodyElement as appropriate
var Scrollparent = require("scrollparent");
Scrollparent(document.getElementById("inside-a-scrolling-div")) // HTMLDivElement
Internally, the root scrolling element is determined in this library as the result of
document.scrollingElement || document.documentElement;
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.
MIT