美文网首页
Animation 曲线运动测试

Animation 曲线运动测试

作者: Micro同学 | 来源:发表于2020-10-20 16:29 被阅读0次

    测试实例如下:

    <div class="outer">
      <div class="ball"></div>
    </div>
    
    .outer {
      width: 1000px;
      height: 500px;
      background: pink;
      position: relative;
    }
    .ball {
      position: absolute;
      width: 50px;
      height: 50px;
      background: aqua;
      animation: move1 1s 0s 1 linear, move2 1s 0s 1 cubic-bezier(1,0,1,1), move3 1s 1s 1 linear, move4 1s 1s 1 cubic-bezier(0,1,1,1);
      animation-fill-mode: forwards;
    }
    @-webkit-keyframes move1 {
      0% {
        top: 0;
      }
      100% {
        top: 200px;
      }
    }
    @-webkit-keyframes move2 {
      0% {
        left: 0;
      }
      100% {
        left: 200px;
      }
    }
    @-webkit-keyframes move3 {
      0% {
        top: 200px;
      }
      100% {
        top: 0;
      }
    }
    @-webkit-keyframes move4 {
      0% {
        left: 200px;
      }
      100% {
        left: 400px;
      }
    }
    

    相关文章

      网友评论

          本文标题:Animation 曲线运动测试

          本文链接:https://www.haomeiwen.com/subject/camdmktx.html