Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iest/buttery-scroll
Uber-simple smooth-scrolling microlib
https://github.com/iest/buttery-scroll
Last synced: 9 days ago
JSON representation
Uber-simple smooth-scrolling microlib
- Host: GitHub
- URL: https://github.com/iest/buttery-scroll
- Owner: iest
- Created: 2015-01-15T13:40:48.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-18T14:06:33.000Z (almost 10 years ago)
- Last Synced: 2024-10-18T17:11:22.146Z (18 days ago)
- Language: JavaScript
- Size: 152 KB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scroll like butter
## [Demo](http://codepen.io/iest/pen/VYpXJy)
## 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:
```js
ButteryScroll(document.querySelector('body'), 300, 900);
```_This is essentially a heavy fork of [Benjamin De Cock](https://twitter.com/bdc)'s sweet [Anchor scrolling library](https://github.com/bendc/anchor-scroll). Thanks Benjamin!_.