Numscrubber.js - 通过左右拖拽改变输入框里的数字大小

618 阅读1分钟
原文链接: github.com

Let's change values of input numbers by dragging the mouse left & right

Install

Include numscrubber.js file

<script src="src/numscrubber.js"></script>

or use CDN

<link rel="stylesheet" href="https://cdn.rawgit.com/mburakerman/numscrubberjs/master/src/numscrubber.js">

Usage

Just add data-numscrubber to your input number

<input data-numscrubber type="number" value="6" min="4" max="50" />

and then call init()

<script>
    Numscrubber.init();
</script>

Thats it!

CodePen demo

CodePen demo

Size

1.2 kb minified

License

Licensed under the MIT License.


本文对你有帮助?欢迎扫码加入前端学习小组微信群: