【问题标题】:is there any way to give multiple value in duration svg animation tag?有没有办法在持续时间 svg 动画标签中赋予多个值?
【发布时间】:2020-07-01 15:28:56
【问题描述】:

我正在尝试在 svg 上执行一些动画操作,但我无法获得我想要的结果是否有任何方法可以添加多个值

<animate attributeType="CSS" attributeName="visibility" from="hidden"  to="hidden" values="hidden;visible;hidden" dur="2s" repeatCount="indefinite"/>

我在 values="..." 中给出了多个值,但是在我想要不同时间跨度的每个值时,有什么可能的方法来做同样的事情,谁能引导我朝着正确的方向前进?

【问题讨论】:

  • 我想为每个值提供自定义的 duratom 对于前 3 个值,所以我希望第一个值需要 0.8 秒,第二个值需要 1.2 秒,第三个应该需要 0.1 秒
  • 它有效,你能把它作为答案吗

标签: html css svg svg-filters svg-animate


【解决方案1】:

使用值和 keyTimes。

例如

<animate attributeType="CSS" attributeName="visibility" values="hidden;visible;hidden" keyTimes="0;0.4;0.6" dur="2s" repeatCount="indefinite"/>

【讨论】:

    猜你喜欢
    • 2021-11-15
    • 2021-01-17
    • 1970-01-01
    • 2013-08-19
    • 2017-02-01
    • 1970-01-01
    • 2021-04-18
    • 1970-01-01
    • 2020-12-05
    相关资源
    最近更新 更多