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.