I'm using Jquery knob (http://anthonyterrien.com/knob/) and it works great but rather than have a dimentionless number displayed in the middle I would like to display units with it ei % or F etc ... How can I do this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
$("input.Measure").knob({
min: 1
max: 10
stopper: true,
readOnly: false,//if true This will Set the Knob readonly cannot click
draw: function () {
$(this.i).val(this.cv + '%') //Puts a percent after values
},
release: function (value) {
//Do something as you release the mouse
}
});
回答2:
As Ben explains on Adding Percentages to jquery knob input value, on the recent versions (>1.2.7) you can use the format hook:
$(".dial").knob({
'format' : function (value) {
return value + '%';
}
});