有没有办法使用Canvas在IE7或IE8? [英] Is there a way to use Canvas in IE7 or IE8?

查看:119
本文介绍了有没有办法使用Canvas在IE7或IE8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IE7和IE8中使用Canvas标记有什么解决方法吗?
让我知道。

Is there any workaround to use "Canvas" tag in IE7 and IE8 ? Pls let me know.

<input type="text" id="textSign" value="Sign" />
<input type="button" onclick="javascript:return changeSign();" value="changeSign" />
<canvas id="e" width="150" height="100"></canvas>
<script type="text/javascript">
var textSign = document.getElementById("textSign").value;
      function changeSign() {
             textSign = document.getElementById("textSign").value;
                    var canvas = document.getElementById("e");
                    var context = canvas.getContext("2d");
                    context.fillStyle = "#4c4c4c";
                    context.font = "30px Giddyup Std";
                    context.fillText (textSign , 20, 50);
                }
            </script>


推荐答案

strong> Yes 时,有一个项目可以在较旧版本的IE(7和8)上模拟canvas API。

Yes, there is a project to simulate the canvas API on older versions of IE (7 and 8).

您可以在这里找到它,只需添加JavaScript文件,然后继续支持画布。

You can find it here, simply include the JavaScript file and go on as canvas was supported.

请注意,是IE的顶层的另一层JavaScript代码(它不是着名的解析JavaScript的速度非常快)

Please note that is another layer of JavaScript code on the top of IE (and it's not famous to be very fast to parse JavaScript...)

这篇关于有没有办法使用Canvas在IE7或IE8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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