1.0.1 • Published 2 years ago

inertia-roll v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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

FieldTypeDefault valueMutable (by initScroll())Description
elObject (dom node)nullNoDOM node to listen mouse event on.
allowBooleantrueNoThis initial value represents whether scrolling is allowed

Instance methods

MethodDescription
setScroll()Set allowed scrolling status.
release()Restore state.