【发布时间】:2011-05-30 16:51:45
【问题描述】:
【问题讨论】:
标签: text internet-explorer-9 raphael
【问题讨论】:
标签: text internet-explorer-9 raphael
我很快就找到了。您创建了元素,但没有将其放在任何地方。将其添加到文档正文后,一切似乎都很好。
this._width=300;
this._height=300;
this._bgSvgContainer = document.createElement("div");
//NOTE: add the created div to the body of the document so that it is displayed
document.body.appendChild(this._bgSvgContainer);
var bgCanvas = Raphael(this._bgSvgContainer, this._width, this._height);
this._bgCanvas = bgCanvas;
var num = this._bgCanvas.text(this._width-10,this._height-10,"1");
【讨论】:
用这么小的代码片段真的很难说(对我来说不能在任何浏览器上运行),但这可能是一个范围问题 this 在 IE 中事件期间与使用 W3C 的 this 完全不同事件模型。请参阅:quirksmode-Event order-Microsoft 模型的问题
【讨论】: