The following code animates the img along the specific #pat path.
<switch>
<g i:extraneous="self">
<path id="pat" style="stroke:url(#grad);" class="mypath" d="
M144.668,123.467c0,0-13.001-133.999-143.668-121.665"/>
</g>
</switch>
<image xlink:href="http://m.kaon.com/icon/17001.png" width="30" height="30" x="-15" y="-15">
<animateMotion rotate="auto" dur="3s" repeatCount="indefinite">
<mpath xlink:href="#pat"/>
</animateMotion>
</image>
Is there any way to loop the animation indefinitely, but to have a delay inbetween. Like animate 0->1, wait 5s, animate 0-1.
Using this resource: http://www.w3.org/TR/SVG11/animate.html#AnimateMotionElement.
You could add another fake/pause element to link the begin/end...first one is just a pause that doesn't really do anything (so it doesn't vanish when its not on the path).
<animateTransform begin="myanim.end" id="pause" dur="3s" type="translate" attributeType="XML" attributeName="transform"/>
<animateMotion id="myanim" dur="6s" begin="0; pause.end" fill="freeze">
<mpath xlink:href="#theMotionPath"/>
</animateMotion>
Example fiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With