1.0.1 • Published 9 years ago

smooth-move v1.0.1

Weekly downloads
159
License
MIT
Repository
github
Last release
9 years ago

smooth-move Build Status

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

Smooth move Ferguson

License

MIT © Ben Drucker