[英]Raphael graphic not showing in IE8
現在,我很難讓一個簡單的Raphael圖形顯示在extJS面板中。
afterRender: function(){
var size = Math.min(this.getHeight(), this.getWidth());
this.innerEl = this.el.createChild({
cls : 'ext-ux-clock-inner'
});
this.canvas = Raphael(this.innerEl.dom, size, size);
var circle = this.canvas.text(50, 40, 'test').attr( {
font : '14px Helvetica, Arial',
stroke : "none",
fill : '#fff'
});
TimelineWindowPanel.superclass.afterRender.apply(this,arguments);
}
文本在Firefox和Chrome中顯示良好,但是我似乎無法在IE8中顯示此文本。 我試過使用未壓縮的版本以及壓縮版本,但沒有運氣。 有人知道為什么Raphael不能與extJS的IE8一起使用嗎?
編輯:如果我將IE8更改為兼容模式,它將顯示Raphael圖形
我找到了解決IE8的方法。 似乎IE8試圖在ExtJS窗口出現在屏幕上之前繪制到畫布上。 我猜發生了什么事,就是IE8試圖在畫布上繪制而失敗,並且沒有嘗試重新繪制。 因此Raphael圖像永遠不會出現在畫布中。 我可以通過使用javascript函數setInterval()
將繪制延遲0.3秒來解決此問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.