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);
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步