Skip to content
Uber-simple smooth-scrolling microlib
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
index.js
package.json

README.md

Scroll like butter

Demo

Usage

Install from npm: npm install buttery-scroll

Call as a function:

ButteryScroll(scrollableElement, distance, duration)

  • scrollableElement: any element that can scroll, e.g. document.body
  • distance: a distance in pixels, a positive or negative value
  • duration: how long the scroll should take, in milliseconds

Example usage:

ButteryScroll(document.querySelector('body'), 300, 900);

This is essentially a heavy fork of Benjamin De Cock's sweet Anchor scrolling library. Thanks Benjamin!.

You can’t perform that action at this time.