The latest version of the jQuery Increment plugin (v. 0.6) now supports use of the mousewheel plugin by Brandon Aaron to increment/decrement numeric input values. Ensure scripts are loaded in the proper order (jquery » mousewheel » increment).
Try it out: jQuery Increment Demo
See the original Increment blog post.
Hi,Sean O!
Thanks for the wonderful script. I have added incremental buttons “+” and “-“.
if (delta > 0 || e.which == 38 || e.which == 107) {
changeTime($id, ‘add’);
// newval = parseFloat(num) + 1 * (e.shiftKey ? .1 : 1);
}
else if ( delta < 0 || e.which == 40 || e.which == 109 ) {
changeTime($id, 'sub');
//newval = parseFloat(num) – 1 * (e.shiftKey ? .1 : 1);
}
Could you please advise how to restore default actions of "backspace" and "delete" buttons. I did something like this:
// backspace
else if ( e.which == 8 ) {
changeAmount($id,'back');
}
[…]
else if (action == 'back') {
// don't allow decrementing below minimum
if (v == opts.minVal) return false;
v = String (v);
v = v.slice(0,v.length-1);
}
But it's not quite right, because it removes only the last digit.