smooth-move

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i smooth-move

Weekly Downloads

89

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bendrucker