开发者

canvas animation to work in IE

Is it possible to have th开发者_Go百科is canvas animation working in IE6~8 ?

Animation here: http://jsfiddle.net/calebo/4qMMy/

I have tried using these 2 plugins but it still won't work.

  • http://code.google.com/p/explorercanvas/
  • http://burzak.com/proj/fxcanvas/


The only way to get canvas to work in older versions of IE is to use some kind of hack.

Canvas was only implemented into IE9, so previous versions don't know anything about it.

There are a number of javascript hacks available which translate Canvas into a VML object for compatibility with IE6-8.

One example is here: http://code.google.com/p/explorercanvas/

Similar hacks exist for SVG, which can also be converted to VML for older IEs. eg http://code.google.com/p/svg2vml/

Please note, however, that no matter how clever these hacks are, you are likely to have some fairly fundamental speed issues with older versions of IE if you're doing anything clever with canvas. These hacks are written in Javascript and need to run in real-time on what is basically the slowest Javascript interpreter around. If you do any kind of complex graphics, the results will not be pretty.

To be honest, I've given up trying to get Canvas to work in older IEs.

The best success I've had with cross-browser dynamic graphics is using the Raphael library. This produces SVG in most browsers, and VML in older IEs, and seems to work well -- and more importantly, reasonably quickly, even in older IEs.

It isn't canvas, but it is cross-browser dynamic graphics, and at the end of the day the end user doesn't really care what you use to draw the graphics, as long as it looks good.


Explorer Canvas has always worked great for me. Did you make sure that you downloaded the latest JS file:

http://code.google.com/p/explorercanvas/downloads/list

and also included this tag at the top of your document:

<head>
<!--[if lt IE 9]><script src="excanvas.js"></script><![endif]-->
</head>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜