scrollable-elements
v0.0.2
Published
Get scrollable elements in specified selector
Downloads
5
Maintainers
Readme
scrollable-elements
Get scrollable elements in specified selector.
Work in IE 9+
and modern browsers.
There are no dependencies on this module.
Install
Installed from npm
.
$ npm install scrollable-elements
API
findAll( selectors, direction )
selectors: String
direction: String("x" | "y") Default("y")
Get all scrollable elements from in specified selector.
It returns an empty array if the element is not found.
import {findAll} from "scrollable-elements"
const elements = findAll(".scrollable");
console.log(elements); // [Element, Element, ...]
find( selectors, direction )
selectors: String
direction: String("x" | "y") Default("y")
Get first found scrollable element in specified selector.
It returns an undefined if the element is not found.
import {find} from "scrollable-elements"
const element = findAll(".scrollable");
console.log(element); // Element