0

我无法在 IE7 中沿着路径移动一个简单的形状(实际上是我尝试过的唯一 IE 版本)。以下代码在 chrome 和 firefox 中运行良好,但在 IE 中运行良好。我找不到明显的原因,有人见过类似的东西吗?

canvas.path(rPath.path).attr("stroke", "blue");
var circle = canvas.circle(rPath.startX, rPath.startY, 5);
circle.animateAlong(rPath.path, 3000, true);

我的 rPath 变量具有路径和起点坐标。

Microsoft 脚本调试器指出这一行是代码中断的地方:

os.left != (t = x - left + "px") && (os.left = t); (line 2131 inside the uncompressed raphael.js script file, inside Element[proto].setBox = function (params, cx, cy) {...})

有任何想法吗?在 IE7 中使用 raphael 的 animateAlong 的任何经验(好或坏)?

TIA,安德烈

4

2 回答 2

1

使用真实路径创建一个圆圈..

拿这个代码... paper.path('M325 35a200 200 0 1 0 1 0' );

并在这里玩... http://www.irunmywebsite.com/raphael/additionalhelp.html?q=animateAlong

于 2010-05-17T20:30:18.877 回答
0

原来是移动圆的原始坐标,在我的示例中为 rPath.startX。它是通过拆分字符串获得的,因此是字符串值。虽然圆圈的定位工作正常,但 animateAlong 在 IE 中却没有那么宽容。

在使用它之前将其解析为 int 可以解决问题。

于 2010-05-19T22:03:37.683 回答