拉斐尔图形没有在IE8中显示 [英] Raphael graphic not showing in IE8

查看:147
本文介绍了拉斐尔图形没有在IE8中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我无法在extJS面板中显示一个简单的Raphael图形。

Right now I'm having trouble getting a simple Raphael graphic to show in a extJS panel.

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中显示。我已经尝试使用未压缩版本以及缩小版本而没有运气。有没有人知道拉斐尔为什么不使用带有extJS的IE8?

The text shows up fine in Firefox and Chrome, however I can't seem to get this text to display in IE8. I've tried using the uncompressed version along with the minified version with no luck. Does anybody know why Raphael doesn't work with IE8 with extJS?

编辑:
如果我将IE8改为兼容模式它显示了Raphael图形

If I change IE8 into the compatibility mode it shows the Raphael graphic

推荐答案

我找到了解决IE8的方法。似乎IE8在ExtJS窗口出现在屏幕上之前尝试绘制到画布上。我猜测正在发生的事情是IE8试图在画布上绘制并失败并且不会尝试重绘。所以拉斐尔的形象永远不会出现在画布上。我能够通过使用javascript函数延迟绘制.3秒来解决这个问题 setInterval()

I found a work around for IE8. It seems that IE8 attempts to draw onto the canvas before the ExtJS window appears on the screen. I'm guessing what's happening is that IE8 attempts to draw onto the canvas and fails and doesn't try to redraw. So the Raphael image never appears in the canvas. I was able to solve this by delaying the draw by .3 seconds using the javascript function setInterval()

这篇关于拉斐尔图形没有在IE8中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆