1.2.2 • Published 7 years ago

rangepicker.js v1.2.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

rangepicker.js

rangepicker.js

Installation

$ 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.

Usage

<div id="rangePicker"></div>
var element = document.getElementById('rangePicker');
var rp = rangepicker(element, options);

API

Properties

PropertyDescription
elementElement where you would like to initialize rangepicker.js.
optionsAn object containing configuration options. Pass {} for defaults.

Options

OptionDescription
rangeAn object containing range options. It consists of size, step and value parameters.
orientationComponent orientation. Possible values horizontal | vertical. Default horizontal.
itemHeightRange item height in px. It will take effect in horizontal mode.
itemWidthRange item width in px. It will take effect in vertical mode.
disabledDefault false. If true, component will be disabled.
onInitializecallback, fired when component is initialized.

Methods

Usage: rp.methodName()

MethodDescription
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.

Events

EventDescription
rp.changeFired when value is changed.

Contribution

  1. Fork it
  2. Create feature branch
  3. Commit changes
  4. Push to the branch
  5. Create new pull request