0.0.2 • Published 9 years ago

scrollable-elements v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

scrollable-elements

Build Status npm version License

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

Author

tsuyoshi wada