@neomasterr/scroll
v1.0.4
Published
Scroll component for browser window
Downloads
16
Maintainers
Readme
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
});