简体   繁体   English

Chrome中的jQuery Knob错误

[英]jQuery Knob bug in Chrome

I have an issue with jQuery Knob in Google Chrome: 我在Google Chrome浏览器中遇到了jQuery旋钮问题:

Everything displays OK until I change the page and click the browser's back button. 一切正常,直到我更改页面并单击浏览器的“后退”按钮。 The percentage is repeated and the circle doesn't display until I refresh the page. 重复百分比,并且直到我刷新页面才显示圆圈。 Please check this link for example: 请检查此链接,例如:

http://gcmdesign.net/temp/knob/ http://gcmdesign.net/temp/knob/

Click the link and then the back button of the browser. 单击链接,然后单击浏览器的后退按钮。

Anyone has any idea why this is happening? 任何人都知道为什么会这样吗? I've tested in FF, IE, safari and it displays OK. 我已经在FF,IE,Safari浏览器中进行了测试,并且显示OK。 Only in Chrome I have this issue. 仅在Chrome中,我有此问题。

I think the problem is because when you get the value with this.cv it has the %, so it's not a valid number. 我认为问题是因为当您使用this.cv获取值时,它具有%,因此它不是有效数字。

Try this (not tested): 试试看(未测试):

$(".dial").knob({
    'draw' : function () { 
        $(this.i).val(this.cv.replace('%','') + '%');
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM