$ npm install rangepicker.js
or clone repository.
Pre build files can be found in the /build
folder.
Include rangepicker.js
and(optionally) rangepicker.css
in your project.
<div id="rangePicker"></div>
var element = document.getElementById('rangePicker');
var rp = rangepicker(element, options);
Property | Description |
---|---|
element |
Element where you would like to initialize rangepicker.js . |
options |
An object containing configuration options. Pass {} for defaults. |
Option | Description |
---|---|
range |
An object containing range options. It consists of size , step and value parameters. |
orientation |
Component orientation. Possible values ```horizontal |
itemHeight |
Range item height in px . It will take effect in horizontal mode. |
itemWidth |
Range item width in px . It will take effect in vertical mode. |
disabled |
Default false . If true , component will be disabled. |
onInitialize |
callback , fired when component is initialized. |
Usage: rp.methodName()
Method | Description |
---|---|
setValue(value) |
Sets given value. |
getValue() |
Returns the component current value. |
next() |
Sets next range value. |
prev() |
Sets previous range value. |
enable() |
Enables component. |
disable() |
Disables component. |
on(event, handler) |
Adds event listener. |
Event | Description |
---|---|
rp.change |
Fired when value is changed. |
- Fork it
- Create feature branch
- Commit changes
- Push to the branch
- Create new pull request