- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试实现 excanvas,以便我的脚本可以在 IE 和符合标准的浏览器中运行。我包括 jquery、excanvas 然后是我的脚本。我正在像这样创建 Canvas 元素:
data.canvas = $(document.createElement('canvas')).attr('width', data.fontwidth * 80 + 'px').attr('height', data.fontheight * 25 + 'px');
$this.append(data.canvas);
但是当我尝试 ctx = data.canvas[0].getContext('2d');
时,我得到一个 Object doesn't support this property or method' 错误那条线。此外,我在 excanvas.js 的第 160 行收到了一个
Invalid argument` 错误。
我的完整代码是 here .工作页面(除 IE 之外的所有内容)是 here .我使用的 excanvas 版本是 here .
更新 解决了第二个错误。我必须在调用 init 函数之前附加元素。
最佳答案
来自docs :
If you have created your canvas element dynamically it will not have the getContext method added to the element. To get it working you need to call initElement on the G_vmlCanvasManager object.
var el = document.createElement('canvas');
G_vmlCanvasManager.initElement(el);
var ctx = el.getContext('2d');
关于javascript - 尝试实现 excanvas 但出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6193513/
我已经通过在 ie8 上实现 excanvas 来努力。我已经对动态元素进行了排序,最初隐藏的元素现在可以在应用程序的大部分地方愉快地呈现,就在一切看起来都很好的时候,我遇到了另一个障碍。excanv
我正在尝试实现 excanvas,以便我的脚本可以在 IE 和符合标准的浏览器中运行。我包括 jquery、excanvas 然后是我的脚本。我正在像这样创建 Canvas 元素: data.canv
您好,我在 IE8 上收到错误“意外调用方法或属性访问”。在“foo.appendChild(canvas);”行我的代码如下。 var foo = document.getElementById
您好,对于简单的示例,我已经设法使 excanvas 在 IE8 中工作,但是我无法使以下包含 drawimage 的 Canvas 示例在 IE8 中工作。有没有人有使用 excanvas 和 dr
嗨,StackOverflow! 我遇到了以下问题:仅在 IE7 上,如果我在 Canvas 上绘制任何内容后调用 drawImage(),excanvas 不会在所需的 x、y 坐标处绘制图像。我查
我正在使用 excanvas 绘制图形形状,下面是我的代码。在调用 .getContext("2d") 方法时,它在 IE7 和 IE8 中显示 'undefined' 异常。 JS var scr
我越来越喜欢 paper.js,但在意识到它不支持 IE8 后,我想知道是否可以让 paper.js 与 excanvas 一起工作?有没有人对此进行过测试,是否有可用的示例? 谢谢。 最佳答案 Pa
Excanvas“for enternet Explorer”对于预定义的 Canvas 元素工作正常。但是当涉及到在脚本中动态创建canvas元素时,就不行了... 有什么想法吗?? 最佳答案 来自
我曾经开发过一个名为“BeautyTips”的 jQuery 插件,它运行得很好。但是,自从我安装了 IE 8,这个插件就停止工作了,因为它需要 Excanvas 来让 IE 绘制矢量、图像等。 我尝
这有效: function canvasTest(){ console.log("beginning canvasTest"); var b_canv
这个问题在这里已经有了答案: Possible to get Excanvas to work in IE 8? (7 个答案) 关闭 9 年前。 在 IE8 上出现以下错误 canvas.getC
我正在使用 jQuery $.getScript() 方法将脚本动态加载到文档中,例如 $.getScript("excanvas.js", function(data){}); 在创建 Canvas
我正在使用 IE7/8 的 jqPlot 渲染 Canvas ,想知道是否可以将其打印为 jpg/png 或任何其他格式。很长一段时间以来,我一直在努力解决这个问题,我在网上得到的唯一答案是不行。是否
我有一个使用 excanvas 绘制一些图像的页面。在 IE6 中测试新页面时,一台计算机尝试打开 Office 2000 并安装缺少的组件。如果取消 office 2000 安装,则会出现 vml
我正在尝试在我的页面的特定于页面的 js 文件中加载 excanvas polyfill。此脚本文件插入到我页面上的 body 标记之后。 奇怪的是,如果我使用 在我的 head 标签中,一切正常,
我写了一个代码片段,它适用于除零之外的所有值。它不将零视为数字并将其发送到 else 条件。所以验证对我来说失败了。我附上了下面的代码。所有非零数字都被接受,但当我在文本框中写入零时,根据我的验证,它
编辑:我已经确定了以下问题的链接,即使用 $(document).ready() 而不是使用 body 的老式 onload 属性 问题 在 IE7 中, Canvas /excanvas 在您点击重
我一直在尝试使用 canvas 和 excanvas 来尝试让一些文本效果在 IE 中很好地工作(因为它的阴影过滤器渲染得非常糟糕)并且除了它没有应用 @font-face 系列(测试使用谷歌网络字体
我遇到了这个错误,我不太确定为什么。我有一个缩小版的 excanvas.js 并且 IE 中出现了一些问题,特别是: var b=a.createStyleSheet(); 我不确定为什么。有没有人有
这个简单的 Canvas 脚本创建了一个带有边框和文本的矩形。它适用于 Chrome 和 FireFox。但该文本在 Internet Explorer 7.0 中不起作用。我包含了 excanvas
我是一名优秀的程序员,十分优秀!