diff --git a/js/jquery.knob.js b/js/jquery.knob.js index ae36b6b..a0b4729 100644 --- a/js/jquery.knob.js +++ b/js/jquery.knob.js @@ -150,10 +150,15 @@ (!this.o.displayInput) && this.$.hide(); - this.$c = $(''); + this.$c = $(document.createElement('canvas')).attr({ + width: this.o.width, + height: this.o.height + }); + if (typeof G_vmlCanvasManager !== 'undefined') { + G_vmlCanvasManager.initElement(this.$c[0]); + } + this.c = this.$c[0].getContext? this.$c[0].getContext('2d') : null; if (!this.c) { @@ -209,13 +214,9 @@ this._draw = function () { // canvas pre-rendering - var d = true, - c = document.createElement('canvas'); - - c.width = s.o.width * s.scale; - c.height = s.o.height * s.scale; + var d = true; - s.g = c.getContext('2d'); + s.g = s.c; s.clear(); @@ -224,8 +225,6 @@ (d !== false) && s.draw(); - s.c.drawImage(c, 0, 0); - c = null; }; this._touch = function (e) { @@ -682,4 +681,4 @@ ).parent(); }; -})(jQuery); \ No newline at end of file +})(jQuery);