试图在 IE8 中制作画布效果。使用 excanvas.js 在 IE7 中没有问题,但在 IE8 中,它不起作用。这个效果被命名为 ECOTree,我已经做了所有的技巧和所有的修改。在 IE8 中运行此效果有什么建议吗?
下面是 ecotree.js 中 ie8 的修改代码:
// 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);
}
}