简体   繁体   中英

Jquery Knob not working in IE 8.

JQuery Knob not working in IE 8. If you look at the site http://anthonyterrien.com/knob/ you'll see the problem. Comparability mode does not seem to work either. Any suggestions ?

Just adding a bit more information to user2147420's answer, you can get excanvas.js here https://code.google.com/p/explorercanvas/downloads/detail?name=excanvas_r3.zip

There are examples with that download but if you want a quick view of how to use it, here is a lnk for that https://code.google.com/p/explorercanvas/wiki/Instructions

Just add this in the head section your html.

<!--[if lt IE 9]>
        <script src="pathToFile/excanvas.js"></script>
<![endif]-->

Note - the page I pointed to above says: "If you have created your canvas element dynamically it will not have the getContext method added to the element. To get it working you need to call initElement on the G_vmlCanvasManager object."

ie add this code to the appropriate place in the jquery knob javascript file

var el = document.createElement('canvas');
G_vmlCanvasManager.initElement(el);
var ctx = el.getContext('2d');

I don't have enough rep to comment on TheGooch's answer so I have to add this as an answer, sorry about that.

I have found that jQuery Knob 1.2.11 already has the code inside it to attempt to load excanvas if the excanvas library is loaded and the jQuery Knob library has been unable to instantiate a Canvas element.

So all you need to do now is add the conditional include in your head like TheGooch mentioned and everything should be sorted on IE8.

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