Socket
Socket
Sign inDemoInstall

scrollparent

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    scrollparent

A function to get the scrolling parent of an html element.


Version published
Weekly downloads
455K
decreased by-1.42%
Maintainers
1
Install size
4.32 kB
Created
Weekly downloads
 

Readme

Source

scrollparent

NPM version Size Download count Build status

A function to get the scrolling parent of a html element.

Install

npm install scrollparent --save

Example

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

Note about the root scrolling element

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.

Contributors

License

MIT

Keywords

FAQs

Last updated on 28 May 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc