1.0.1 • Published 9 years ago
smooth-move v1.0.1
smooth-move
Smoothly scroll a scrollable element
Install
$ npm install --save smooth-move
Usage
var scroll = require('smooth-move')
scroll(element, {
x: 0,
y: 20
})
//=> scrolls the element down `y` pixels
API
scroll(element, options)
-> undefined
element
Required
Type: HTMLElement
A scrollable element.
options
x / y
Required
Type: number
Distance to scroll along the x/y axes.
ease
Type: string
/ function
Default: 'ease'
An easing function (see bezier-easing)
duration
Type: number
Default: 1000
The duration of the animation
License
MIT © Ben Drucker