Simple and easy Input Spinner.
Support:
- Float numbers
- Internationalized number formatting
Include inumber.min.css
and inumber.min.js
.
<div id="inumber">
<input type="text"/>
</div>
Float Input:
<div id="inumber-float">
<input type="text"/>
</div>
var inumber = new INumber.default('#inumber', {options});
For float numbers:
var inumberFloat = new INumber.default("#inumber-float", {
float: true,
decimals: 2
});
decreaseText: '-'
- decrease button textincreaseText: '+'
- increase button textfloat: false
- float valuesdecimals: 0
- decimals for float valueslocale: ''
- navigator.language as default or Intl codeinputPosition: 'between'
- input position - 'between', 'left' or 'right'init: function(instance) {}
- after initchange: function(value, formatValue, el, id) {}
- after change
inumber.setValue(2);
- set value
inumber.setMin(10);
- set min
inumber.setMax(20);
- set max
inumber.setStep(2);
- set step
<div id="inumber" class="inumber">
<button type="button" class="inumber-button is-decrease">
<input type="number" class="inumber-input"/>
<button type="button" class="inumber-button is-increase">
</div>