【问题标题】:SVG animation delaySVG动画延迟
【发布时间】:2017-09-12 16:01:42
【问题描述】:

要求:我在为每个动画设置延迟时遇到了一些问题。

演示:https://codepen.io/anon/pen/OxJXvZ

但逻辑不同。每一行必须用蓝色,一一填充。

如果我设置了 begin 属性,它会完全破坏任何动画规则

这是我的代码

<linearGradient id="first">
<stop offset="0" stop-color="#4caddb">
    <animate id="anima1" begin="anima2.end" dur="1s" attributeName="offset" fill="freeze" from="0" to="1" repeatCount="indefinite" />
</stop>
<stop offset="0" stop-color="#E1E1E1">
    <animate dur="1s" attributeName="offset" fill="freeze" from="0" to="1" repeatCount="indefinite" />
</stop>
</linearGradient>

<linearGradient id="third">
<stop offset="0" stop-color="#E1E1E1">
    <animate id="anima2" dur="1s" begin="anima1.end" attributeName="offset" fill="freeze" from="1" to="0" repeatCount="indefinite" />
</stop>
<stop offset="0" stop-color="#4caddb">
    <animate dur="1s" attributeName="offset" fill="freeze" from="1" to="0" repeatCount="indefinite" />
</stop>
</linearGradient>

我错过了什么?

【问题讨论】:

    标签: html animation svg vector delay


    【解决方案1】:

    repeatCount="indefinite" 的动画没有结束,因此您的引用动画永远不会开始。请改用begin="anima1.repeat"。每次引用的动画重新开始时都会引发此事件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-21
      • 2015-10-19
      • 2018-10-31
      • 1970-01-01
      • 1970-01-01
      • 2012-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多