首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有没有办法增加两个放大器动画到一个单一的div?

有没有办法增加两个放大器动画到一个单一的div?
EN

Stack Overflow用户
提问于 2018-08-30 09:19:13
回答 1查看 241关注 0票数 4

这是我的代码,在body标记中,如docs中所指定的:

代码语言:javascript
复制
   <amp-animation layout="nodisplay" trigger="visibility">
    <script type="application/json">
        [
            {
                "selector": ".shape-3",
                "duration": 1000,
                "delay": 0,
                "keyframes": "buildInKeyframes",
                "fill": "both",
                "direction": "normal"
            },
            {
                "selector": ".shape-3",
                "duration": 1000,
                "delay": 1200,
                "keyframes": "buildOutKeyframes",
                "fill": "both",
                "direction": "normal"
            }

        ]
    </script>
    </amp-animation>

(在head标签中,我有用标签样式和自定义定义的关键帧)我有一个带有class=“first 3”的div,我想用第一个动画来动画它,在它完成之后,用第二个动画来动画。问题是

EN

回答 1

Stack Overflow用户

发布于 2022-01-07 07:56:11

您可以尝试以下列方式使用动画:

代码语言:javascript
复制
<amp-animation layout="nodisplay">
  <script type="application/json">
    {
      "selector": ".shape-3",
      "duration": "1s",
      "iterations": "1",
      "fill": "both",
      "direction": "alternate",
      "animations": [
        {
          "selector": ".target-class",
          "easing": "cubic-bezier(0,0,.21,1)",
          "keyframes": {
            "transform": "rotate(20deg)"
          }
        },
        {
          "delay": "1s",
          "easing": "cubic-bezier(0,0,.21,1)",
          "keyframes": {
            "transform": "rotate(30deg)"
          }
        }
      ]
    }
  </script>
</amp-animation>

其中,第二动画的延迟是用于第一次动画的时间。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52093405

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档