使用 Raphael.js 旋转图像

发布于 2025-01-04 08:12:37 字数 252 浏览 5 评论 0原文

我正在尝试创建一个可以旋转动画的按钮。 我找到了一些旋转脚本,但它们不起作用,我找不到问题所在。

这还不够吗?

var angle = 90

function rotRect2()
{ 
rect2.animate({rotation: angle}, 1000, ">");
}

我的动画名称是 rect2,我的按钮正在调用函数 rotRect2

有帮助吗?

谢谢

Im trying to create a button that will rotate my animation.
I have found some rotating scripts, but they wont work I cant find the problem.

Shouldn't this be enough ?

var angle = 90

function rotRect2()
{ 
rect2.animate({rotation: angle}, 1000, ">");
}

my animation name is rect2 and my button is calling the function rotRect2

Any help ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

习惯成性 2025-01-11 08:12:37

var 角度 = 90 ;

我想你忘记了“;”还是有其他问题?

var angle = 90 ;

I think you forgot the ";" there or is it another problem?

美人如玉 2025-01-11 08:12:37

如果您正在查看此示例
他们使用的是 {transform: "r" + angle} 形式

我认为 rect 中没有 rotation 属性 < a href="http://www.w3.org/TR/SVG/shapes.html#RectElement" rel="nofollow">SVG 元素

If you're looking at this example,
they're using the {transform: "r" + angle} form

I don't think there is a rotation attribute in the rect SVG Element

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文