【发布时间】:2017-03-29 06:51:43
【问题描述】:
我想通过滚动上的 svg 路径移动对象=)我试图将滚动上的部分路径添加到路径中,但它仍然不起作用。帮助!!!=) https://jsfiddle.net/YuriiBielozertsev/Ltx9ed0L/
<?xml version="1.0"?>
<svg viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Draw the outline of the motion path in grey, along with 2 small circles at key points -->
<path d="M10,110 A120,120 -45 0,1 110 10 A120,120 -45 0,1 10,110" stroke="green" stroke-width="2" fill="none" id="theMotionPath"/>
<circle cx="10" cy="110" r="3" fill="#000"/>
<circle cx="110" cy="10" r="3" fill="#000"/>
<!-- Red circle which will be moved along the motion path. -->
<circle cx="0" cy="" r="5" fill="red">
<!-- Define the motion path animation -->
<animateMotion dur="6s" repeatCount="indefinite">
<mpath xlink:href="#theMotionPath"/>
</animateMotion>
</circle>
</svg>
【问题讨论】:
-
嗨。可悲的是,您的问题太模糊了,这就是您获得或将获得否决票的原因。获得答案的最快途径是转到jsfiddle.net 并设置该问题的工作演示。然后我们可以快速检查它,而不必浪费时间猜测。将指向小提琴的链接发布在您的答案中,您将获得更好的回复。
标签: javascript jquery html svg svg-animate