1.0.3 • Published 1 year ago

@neomasterr/scroll v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

scroll

Install

npm install @neomasterr/scroll

Usage

Example 1

default behaviour

import Scroll from '@neomasterr/scroll';

Scroll.to(document.getElementById('foo'));

Example 2

custom options

import Scroll from '@neomasterr/scroll';

Scroll.to(document.getElementById('foo'), {
    time: 2.0,
    fps: 60,
    offsetY: 500,
    interruptable: false,
});

Example 3

callback (promise)

import Scroll from '@neomasterr/scroll';

Scroll.to(document.getElementById('foo')).then(() => {
    // scroll done
}).catch(() => {
    // scroll interrupted    
});