# range-picker
**Repository Path**: touchx/range-picker
## Basic Information
- **Project Name**: range-picker
- **Description**: 依赖于JQuery 的范围选择工具
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 12
- **Created**: 2016-03-16
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
#range-picker
a range picker of JQuery plugins
Screenshot
---

Examples
---
1. see `sample` folder
2. [jsfiddle](https://jsfiddle.net/cqmyg/me1dmz9e/4/)
Browser Support
---
1. chrome
2. firefox
3. IE8+
Requirements
---
1. JQuery 1.7+
Usage
---
###Import css
```html
```
###Import javascript
```html
```
###Call
```javascript
$("#date_picker").rangepicker();
```
Options
---
####startValue
default: `none`
require: `true`
the left label. eg: "2016/01/03"
####endValue
default: `none`
require: `true`
the right label. eg: "2016/03/12"
####type
type: `String`
default: `single`
require: `false`
Choose picker type, could be `single` - for one cursor, or `double` for two cursors
######example
```js
$("#number_range").rangepicker({
type: "double",
startValue: 0,
endValue: 100,
translateSelectLabel: function(currentPosition, totalPosition) {
return parseInt(100 * (currentPosition / totalPosition));
}
});
```
####translateSelectLabel
type: `Function`
default: `none`
require: `true`
######parameter
1. `currentPosition` cursor position
2. `totalWidth` the width of process bar
get the text for cursor
######example
```js
$("#number_range").rangepicker({
startValue: 0,
endValue: 100,
translateSelectLabel: function(currentPosition, totalPosition) {
return parseInt(100 * (currentPosition / totalPosition));
}
});
```
Function
---
####getSelectValue
get selected range
Build
---
First, get a copy of the git repo by running:
```shell
git clone https://github.com/zhangtasdq/range-picker.git
```
Enter the directory and install the dependencies:
```shell
cd range-picker && npm install && bower install
```
Build
```shell
grunt
```
Test
```shell
grunt test
```