scrollto-element
A simple animated scroll to element function.
- Using requestAnimationFrame
- Only require bezier-easing and raf
Install
npm install scrollto-element --save// oryarn add scrollto-element
Usage
const scrolltoElement = // or ES2015+
Example
// advanced
offset means scroll to (target element + offset).
When offset is a positive number, view will scroll through the target.
When offset is a negative number, view will scroll to near the target.
See also
License
MIT