Digital subtraction
When submitting orders as Jingdong currently using about digital subtraction effect, this effect is straightforward, easy to operate. We use digital subtraction jquery.spinner.js about plug-in implementation, call the method is very simple, see a demo.
<input type="text" class="spinner"/>
Calls are also very simple, first load jquery libraries and jquery.spinner.js, then use the following code:
$('.spinner').spinner();
Bootstrap style right subtraction
Bootstrap fire for a long time, a variety of applications based on bootstrap style very much, here to introduce a bootstrap-based digital subtraction plugin, you can set the minimum, maximum, increment decrement (step value), you can manually enter numbers .
<div class="input-group spinner" data-trigger="spinner" id="spinner">
<input type="text" class="form-control" value="1" data-max="10" data-min="1" data-step="1">
<div class="input-group-addon">
<a href="javascript:;" class="spin-up" data-spin="up"><i class="icon-sort-up"></i></a>
<a href="javascript:;" class="spin-down" data-spin="down"><i class="icon-sort-down"></i></a>
</div>
</div>
After the bootstrap related css and js file is loaded, you can directly see the results page, if your project is based on bootstrap, then you can call it directly. See demo 2.
jQuery ui style right subtraction
jQuery ui plugin also provides a digital subtraction, you can set the minimum, maximum, increment decrement (step value), you can manually enter numbers. See the demo 3,
<input type="text" id="spinner"/>
If your project uses a jquery ui, then you can call jquery ui to digital subtraction of the function.
$("#spinner").spinner({
max:10,
min:0,
step:2
});