简体   繁体   中英

jQuery Knob bug in Chrome

I have an issue with jQuery Knob in Google Chrome:

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/

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. Only in Chrome I have this issue.

I think the problem is because when you get the value with this.cv it has the %, so it's not a valid number.

Try this (not tested):

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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