jquery.range.js 滑块

<link rel="stylesheet" href="./css/jquery.range.css">


<div class="ip-son">
<div class="demo">
<input type="hidden" class="single-slider3" value="0"/>
<div class="demo-son2">
<input type="text" class="ipgs" value="0">
</div>
</div>
</div>

<script src="./js/jquery.range.js"></script>
var test;
//ip个数
test = $('.single-slider3').jRange({
//滑块滑动时 触发的函数
onstatechange: function () {
$('.ipgs').val($('.single-slider3').val());
},
from: 0,//最小值
to: 1000,//最大值
step: 20,//步进
//这里改变值
scale: [0, 250, 500, 750, 1000],
format: '%s',
width: 500,//总宽度
showLabels: true,
showScale: true
});
$(".ipgs").blur(function () {
test.setValue( $(this).val());//能绑定滑块的变化
});

这里是设置函数绑定滑块的变化

return result || this 改成return result || this.data('plugin_' + pluginName);

posted @ 2019-03-12 14:58  小猴子会上树  阅读(1960)  评论(0编辑  收藏  举报