inertia-roll
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i inertia-roll

    Weekly Downloads

    3

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    15.4 kB

    Total Files

    7

    Last publish

    Collaborators

    • endsion