JS:
Math.easeIn = function (val, min, max, strength) {
val /= max;
return (max-1)*Math.pow(val, strength) + min;
};
$('.slide-me').slider({
min: 1,
max: 1000000,
slide: function(e, ui){
var y = Math.easeIn(ui.value, 1, 1000000, 2.5);
$('#amount').val(Math.round(y));
$('input').change(function(e) {switch (this.id) {case "amount":$('.slide-me').slider("value", $('#amount').val())
break;}})
}
});
HTML:
<div class="slide-me"></div><input type="text" id="amount" style="" />
因此,在切换键盘后,非线性步骤消失