如何使用 Jquery Knob 显示单位 [英] How to display units with Jquery Knob

查看:14
本文介绍了如何使用 Jquery Knob 显示单位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Jquery 旋钮 (http://anthonyterrien.com/knob/),它可以工作很好,但我不想在中间显示一个无量纲的数字,我想用它来显示单位 ei % 或 F 等...我该怎么做?

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?

推荐答案

$("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
    }
});

这篇关于如何使用 Jquery Knob 显示单位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆