scrollr
This is a simple javascript scroll bar built for modern browsers.
Requires
- jQuery
- dragger - https://github.com/cuth/dragger
Use
- Include the required files
- Include scrollr.js and scrollr.css
- Run this code for only non touch devices. Use whatever method you want to detect a touch device.
- Instantiate the object on an element that has
overflow: scroll
- Run
setBarSize
when you have initalized all of you scroll objects. This should be run after every initialize because changing the overflow property can change the size of the element.
Example
if (!("ontouchstart" in window)) {
var sb = new Scrollr('body');
}
Add lib/addWheelListener.js for more mouse wheel browser support.