jRange滑动选取数值范围插件

当我们在页面上需要选择数值范围时,如购物时选取价格区间,购买主机时自主选取CPU,内存大小配置等,使用直观的滑块条直接选取想要的数值大小即可,无需手动输入数值,操作简单又方便。

为大家介绍一款jquery插件jRange;

官网地址:http://nitinhayaran.github.io/jRange/demo/
git地址:https://github.com/nitinhayaran/jRange


html代码:

<div class="demo">
		<input type="hidden" class="slider-input01" value="23" /><a>获取值</a>
	</div>
	<div class="demo">
		<input type="hidden" class="slider-input02" value="50" /><a>获取值</a>
	</div>
	<div class="demo">
		<input type="hidden" class="slider-input03" value="20" /><a>获取值</a>
	</div>
	<div class="demo">
		<input type="hidden" class="slider-input04" value="40" /><a>获取值</a>
	</div>
	<div class="demo">
		<input type="hidden" class="slider-input05" value="40" /><a>获取值</a>
	</div>

js代码:
$('.slider-input01').jRange({
			from: 0,
			to: 100,
			step: 1,
			scale: [0,25,50,75,100],
			format: '%s',
			width: 300,
			showLabels: true
		});
		
		$('.slider-input02').jRange({
			from: 0,
			to: 100,
			step: 1,
			scale: [0,20,40,60,80,100],
			format: '%s',
			width: 400,
			showLabels: true
		});
		
		$('.slider-input03').jRange({
			from: 0,
			to: 100,
			step: 20,
			scale: [0,20,40,60,80,100],
			format: '%s',
			width: 300,
			showLabels: true
		});
		
		$('.slider-input04').jRange({
			from: 0,
			to: 100,
			step: 1,
			scale: [0,20,40,60,80,100],
			format: '%s',
			width: 300,
			showLabels: true,
			isRange:true
		});
		
		$('.slider-input05').jRange({
			from: 0,
			to: 100,
			step: 1,
			scale: [0,20,40,60,80,100],
			format: '%s',
			width: 300,
			showLabels: true,
			disable:true
		});
		
		$('.demo a').on('click',function(){
		  alert($(this).siblings('input').val());
		});


demo地址:http://test.ixiewei.com/jRange/


jRange

jRangejRange

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值