How to loop SVG animation sequence?

后端 未结 3 878
隐瞒了意图╮
隐瞒了意图╮ 2020-12-14 01:13

I have sequence of animationTransform:



        
相关标签:
3条回答
  • 2020-12-14 01:47

    Figured it out already. Solution for those who are interested:

    <animateTransform id="anim1" attributeName="transform" attributeType="XML" type="rotate" from="0" to="30" begin="0s; anim2.end" dur="0.4s" fill="freeze"/>
    <animateTransform id="anim2" attributeName="transform" attributeType="XML" type="rotate" from="30" to="0" begin="anim1.end" dur="0.4s" fill="freeze"/>
    
    0 讨论(0)
  • 2020-12-14 01:50

    You can also just loop within a single animateTransform by providing a values attribute with a semi-colon separated list:

    <animateTransform attributeName="transform" type="rotate"
         values="0;30;0" begin="0s" dur="0.8s" fill="freeze"
         repeatCount="indefinite" />
    

    Here's an example (checked in Firefox 4.0 and Chrome).

    0 讨论(0)
  • 2020-12-14 01:59

    it's also possible to add/subtract (milli)seconds:

      begin="anim2.end-500ms"
    
    0 讨论(0)
提交回复
热议问题