A jQuery/Boostrap based widget for use on text and number inputs to turn them into Bootstrap input groups with plus and minus buttons for incrementing and decrementing the input's numeric value.
- jquery 1.9.1 - 3
- bootstrap ~3.3.7
- jaaulde-template-manager ~1.0.0
bower install bootstrap-number-incrementer
npm install bootstrap-number-incrementer
Download the code, link it in your HTML file (after dependencies).
<script src="/path/to/bootstrap-number-incrementer.js"></script>
###options
Option | Description | Default | Note |
---|---|---|---|
width_factor |
How to maintain the width of the widget. | 'dynamic' |
dynamic changes the width as the length of the input's value changes, and center-aligns the text. range sets the width based on the maximum possible length of value (determined by the input's min and max attributes) and right-aligns the text. Any other value tells the widget to avoid dealing with width (you can control it yourself by CSS or other means). |
input_class |
Additional class(es) to add to the input element | null |
Whitespace separated list |
wrapper_class |
Additional class(es) to add to the element that is wrapped around the widget | null |
Whitespace separated list |
incrementer_class |
Additional class(es) to add to the increment (+) button | null |
Whitespace separated list |
decrementer_class |
Additional class(es) to add to the decrement (-) button | null |
Whitespace separated list |