>  기사  >  웹 프론트엔드  >  CSS 하향 바운스 애니메이션 효과

CSS 하향 바운스 애니메이션 효과

PHPz
PHPz앞으로
2023-08-25 20:45:201126검색

CSS 向下弹跳动画效果

CSS를 사용하여 Bounce In Down 애니메이션 효과를 얻으려면 다음 코드를 실행해 보세요.

Example

Live Demo

<html>
   <head>

      <style>
         .animated {
            background-image: url(/css/images/logo.png);
            background-repeat: no-repeat;
            background-position: left top;
            padding-top:95px;
            margin-bottom:60px;
            -webkit-animation-duration: 10s;
            animation-duration: 10s;
            -webkit-animation-fill-mode: both;
            animation-fill-mode: both;
         }

         @-webkit-keyframes bounceInDown {
            0% {
               opacity: 0;
               -webkit-transform: translateY(-2000px);
            }
            60% {
               opacity: 1;
               -webkit-transform: translateY(30px);
            }
            80% {
               -webkit-transform: translateY(-10px);
            }
            100% {
               -webkit-transform: translateY(0);
            }
         }

         @keyframes bounceInDown {
            0% {
               opacity: 0;
               transform: translateY(-2000px);
            }
            60% {
               opacity: 1;
               transform: translateY(30px);
            }  
            80% {
               transform: translateY(-10px);
            }
            100% {
               transform: translateY(0);
            }
         }
         .bounceInDown {
-           webkit-animation-name: bounceInDown;
            animation-name: bounceInDown;
         }
      </style>
   </head>

   <body>
      <div id="animated-example" class="animated bounceInDown"></div>
      <button onclick="myFunction()">Reload page</button>
      <script>
         function myFunction() {
            location.reload();
         }
      </script>
   </body>

</html>

위 내용은 CSS 하향 바운스 애니메이션 효과의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 tutorialspoint.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제