如何使用AnimAtemotion更改SVG图像的开始位置?
我正在尝试更改SVG映像的启动位置,以使用and AnimAtemotion
沿路径进行动画动画,
您可以在此处检查当前结果 https://jsfiddle.net/7espvwuz/
在此小提琴中,我使用一个圆圈来模拟我的图像。
问题是,
- 如果我使用
cx = 0
和cy = 0
, - 如果我使用
cx = 0
和<代码> cy = 100 ,圆的位置完美,但动画在y
axis中以100
的值移动。
我在做什么错?
I am trying to change the start position of an svg image to animate it along a path using animateMotion
You can check the current result here https://jsfiddle.net/7espvwuz/
In this fiddle I am using a circle to mock my image.
The problem is
- if I use
cx = 0
andcy = 0
, the animation starts at a wrong position - if I use
cx = 0
andcy = 100
, the circle is perfectly positioned but the animation is shifted by a value of100
in they
axis.
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以为圆圈提供所需的CX和CY(
cx =“ 6.25” CY =“ 100”
)和set
当动画开始时,这些属性为0。请阅读有关 set element 。
You can give the circle the desired cx and cy (
cx="6.25" cy="100"
) andset
those attributes to 0 when the animation begins.Please read about the set element.