-1

Trying to make a canvas effect work in IE8. With excanvas.js there is no problem in IE7, but in IE8, it doesn't work. The effect is named ECOTree, and I have made all the tricks and all the modifications included here. Any suggestions to run this effect in IE8?

Here is the modified code for ie8 in ecotree.js:

// Make the <canvas> element.
var canvas = document.createElement('canvas');
jQuery(canvas).attr('width', 2000).attr('height', 7000).attr('id', 'ECOTreecanvas').appendTo(this.treeContainer);
if ((jQuery.browser.msie) && (parseInt(jQuery.browser.version, 10)<=8)){
    // For Internet Explorer, have excanvas initialize the canvas method
    // Modification, the major versions greater than 8 don't need excanvas.
    canvas.setAttribute('width', '2000');
    canvas.setAttribute('height', '7000');
    canvas.setAttribute('id', 'ECOTreecanvas');
    this.treeContainer.append(canvas);
    if (typeof G_vmlCanvasManager != 'undefined') {
        canvas = G_vmlCanvasManager.initElement(canvas);
    }
}
Community
  • 1
  • 1
Pymoo
  • 127
  • 1
  • 4
  • 11
  • Show code. Excanvas works fine for me in IE8 – Andrew Aug 12 '11 at 13:52
  • possible duplicate of [Possible to get Excanvas to work in IE 8?](http://stackoverflow.com/questions/941170/possible-to-get-excanvas-to-work-in-ie-8) – Prestaul Jul 07 '13 at 03:06

2 Answers2

-1

Nothing you posted looks incorrect, you will need to provide more detail, however I can say that a lot of your code is redundant.

// Make the <canvas> element.
var canvas = $('<canvas id="ECOTreecanvas" width="2000" height="7000"></canvas>').appendTo($(this.treeContainer));
if (typeof G_vmlCanvasManager != 'undefined') {
    G_vmlCanvasManager.initElement(canvas);
}

I am assuming here you only include excanvas when the browser is old.

Andrew
  • 13,757
  • 13
  • 66
  • 84
  • Yes, you are right, there are a lot of redundant code, and your assumption is accepted I just include excanvas when the browser is old `` – Pymoo Aug 12 '11 at 14:38
  • Still not working, any suggestions, something i'm doing wrong or some new trick known? – Pymoo Aug 15 '11 at 09:28
  • 1
    @Pymoo If you have solved it yourself then share you solution as an answer and accept it. You never know if someone else might have the same problem. :) – Andrew Aug 17 '11 at 13:59
-1

I have solved the problem by forcing an event to update the canvas element. I know it is an unorthodox mechanism but apparently updating with jquery ready method was not enough

Pymoo
  • 127
  • 1
  • 4
  • 11