numble
Description
numble is a simple jQuery plugin to override the default HTML5 field, to facilitate better cross browser styling and consistency. The default number input renders differently in different browsers making it difficult to match styles. numble hides the original control and adds a new element containing the hidden original. The new control allows the number to be changed using either the mouse scroll wheel or embedded increment and decrement controls.
Installation & Usage
Download or clone the repo and include the jquery.numble.min.js file in your html. numble is a jQuery plugin so be sure it is loaded after jQuery
numble can then be called on the desired input(s)
;
Parameters
numble accepts the following parameters with defaults listed
;
Styling
numble adds a few elements add classes to the page and control. Inline CSS is not added by numble other than to hide the original input, you will need to provide styles for the control in your own stylesheet or use the demo stylesheet.
/* These styles are only applicable if includeButtons is set to true */
Form interactions
numble updates the original hidden field with the number as it changes, the change event of the field is bound to update the display of the control on change.
Changelog
1.0.1
- Add disabled control support
1.0.2
- Add readonly control support, if original control is readonly or disabled, number value cannot be changed with buttons or direct edit
- Prevent increment number value with direct edit beyond min/max values. Number display will revert to previous number on blur.
1.1.0
- Added new setting hideButtonsOnMinMax
Thanks
Based on the excellent jquery-boilerplate/jquery-boilerplate