jquery数字微调组件jQuery.spinner功能如下:
- 向上箭头递增;
- 向下箭头递减;
- 支持鼠标和键盘操作,持续变化;
示例1:简单用法:
<!-- // ref javascript file -->
<script src="dist/js/jquery.spinner.js"></script>
<script>
// 下面这行可以省略
$('[data-trigger="spinner"]').spinner();
</script>
<!-- // spinner plugin DOM -->
<div data-trigger="spinner">
<button type="button" data-spin="up">+</button>
<input type="text" value="1" data-ruler="quantity">
<button type="button" data-spin="down">-</button>
</div>
示例2:获取事件:
<script src="jquery.js"></script>
<script src="dist/js/jquery.spinner.js"></script>
<script>
$("#spinner")
.spinner('delay', 200) //delay in ms
.spinner('changed', function(e, newVal, oldVal) {
// trigger lazed, depend on delay option.
})
.spinner('changing', function(e, newVal, oldVal) {
// trigger immediately
});
</script>
<div data-trigger="spinner" id="spinner">
<button type="button" data-spin="up">+</button>
<input type="text" value="1" data-ruler="quantity">
<button type="button" data-spin="down">-</button>
</div>
参考:
最新评论
本来在正常下载,突然就不能下载,并出现报错:a socket operation was attempted to an unreachable network。请问是什么原因呢
试了,还是不行,能不能更新一下
试了,确实不行,能不能更新一下
也推荐一下我自己写的 https://twitdown.com