scroll-parents
Simple function that returns an array with all the scrolling parent nodes of a given element. Useful if an element needs to listen to the scroll event of all it's parent nodes.
Install
npm install scroll-parents --save
Examples
With scrolling parents
; const myNode = document; ; // Output: [scrollingParent, Window]
The array is ordered from closest scrolling parent (left) to most distant scrolling parent (right), always ending with the Window object.
Without scrolling parents
; const myNode = document; ; // Output: [Window]
License
ISC