Scrolly: fast vanilla JS scrollbar plugin
Aim is a fast + good looking scrollbar with zero dependencies, small size & major browsers support.
At the moment MutationObserver
requires IE11, but works in all major desktop & mobile browsers.
Usage
var ids = scrolly.bar(query|node|string, params);
var id = scrolly.barNode(node, params);
scrolly.dispose(id);
scrolly.disposeAll();
Details
Data: DOM elements
data: LESS:
wrap .scrolly
area .area
bar .area + .bar
thumb .thumb
Data: numbers
data.wrapRatio
: float 0..1
. Calculated as wrapSize / areaSize
. When === 1
no scrollbar is shown.
Planned
- Infinite Scroll callback
- React.js Component
Setup
- Clone this repo.
- Install Node.js. Then Gulp:
npm install -g gulp
. - Terminal, from project directory:
- Dev dependencies:
npm install
. gulp -T
to see all available stuff.gulp watch
to run a local dev server, open in on localhost:3001.gulp build-all
to clean & build everything.