npm.io
1.0.1 • Published 4 years ago

inertia-roll

Licence
ISC
Version
1.0.1
Deps
0
Size
15 kB
Vulns
0
Weekly
0

inertia-roll

Inertial scrolling under dragging scene. When the mouse moves into the upper or lower part of the container, it will scroll automatically

Installing

npm i -S inertia-roll

Usage

import { initScroll, setScroll, release } from 'inertia-roll';
// init
initScroll(el,false)
// Set whether scrolling is allowed
setScroll(allow)
// release
release() // true

API

Options
Field Type Default value Mutable (by initScroll()) Description
el Object (dom node) null No DOM node to listen mouse event on.
allow Boolean true No This initial value represents whether scrolling is allowed
Instance methods
Method Description
setScroll() Set allowed scrolling status.
release() Restore state.

Keywords