Native instant behaviour scroll to DOM element
npm install @neomasterr/scroll
default behaviour
import Scroll from '@neomasterr/scroll';
Scroll.to(document.getElementById('foo'));custom options
import Scroll from '@neomasterr/scroll';
Scroll.to(document.getElementById('foo'), {
time: 2.0,
fps: 60,
offsetY: 500,
interruptable: false,
});callback (promise)
import Scroll from '@neomasterr/scroll';
Scroll.to(document.getElementById('foo')).then(() => {
// scroll done
}).catch(() => {
// scroll interrupted
});