嘗試在IE8中使畫布效果起作用。使用excanvas.js在IE7中沒有問題,但在IE8中,它不起作用。效果被命名爲ECOTree,並且我做了所有的技巧和所有修改,包括here。任何建議在IE8中運行這種效果?Excanvas.js在IE8中無法工作
下面是IE8在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);
}
}
顯示代碼。 Excanvas在我的IE8中工作正常 – Andrew
可能的重複[可能獲得Excanvas在IE 8中工作?](http://stackoverflow.com/questions/941170/possible-to-get-excanvas-to-work-in- ie-8) – Prestaul