使用 CSS 设置动画缓慢结束


使用 animation-timing-function 性能,轻松输出值来使用 CSS 设置动画缓慢结束

示例

实时演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 150px;
            height: 200px;
            position: relative;
            background-color: #808000;
            animation-name: myanim;
            animation-duration: 2s;
            animation-direction: alternate-reverse;
            animation-iteration-count: 3;
         }
         @keyframes myanim {
            from {left: 100px;}
            to {left: 200px;}
         }
         #demo {animation-timing-function: ease-out;}
      </style>
   </head>
   <body>
      <div id = "demo">ease-out effect</div>
   </body>
</html>

更新于: 24-6-2020

733 次浏览

开启你的事业

完成课程以获得认证

开始
广告
© . All rights reserved.