#range-picker
a range picker of JQuery plugins
sample
folder###Install
######download
######bower
bower install --save range-picker
###Import css
<link rel="stylesheet" href="../css/range-picker.css" type="text/css" charset="utf-8" />
###Import javascript
<script src="../bower_components/jquery/dist/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="../src/range_picker.js" type="text/javascript" charset="utf-8"></script>
###Call
$("#date_picker").rangepicker();
####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
$("#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
currentPosition
cursor positiontotalWidth
the width of process barget the text for cursor
######example
$("#number_range").rangepicker({
startValue: 0,
endValue: 100,
translateSelectLabel: function(currentPosition, totalPosition) {
return parseInt(100 * (currentPosition / totalPosition));
}
});
####getSelectValue
get selected range
###updatePosition
######parameter
endPosition
the right cursor positionstartPosition
the left cursor positionset the cursor position
######example
var rangePicker = $("#number_range").rangepicker({
startValue: 0,
endValue: 100,
translateSelectLabel: function(currentPosition, totalPosition) {
return parseInt(100 * (currentPosition / totalPosition));
}
});
rangePicker.updatePosition("-50px", "10%");
// rangePicker.updatePosition("-50px");
// rangePicker.updatePosition("-50px", "50px");
// rangePicker.updatePosition("90%", "10%");
First, get a copy of the git repo by running:
git clone https://git.oschina.net/syjefbz/range-picker.git
Enter the directory and install the dependencies:
cd range-picker && npm install && bower install
Build
grunt
Test
grunt test
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型