Excanvas“for enternet Explorer”对于预定义的 Canvas 元素工作正常。但是当涉及到在脚本中动态创建canvas元素时,就不行了...
有什么想法吗??
最佳答案
来自 the documentation :
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.
var el = document.createElement('canvas');
G_vmlCanvasManager.initElement(el);
var ctx = el.getContext('2d');
关于javascript - 用于动态创建 Canvas 元素的 Excanvas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1635419/