css3動畫特效:上下晃動的div

來源:互聯網
上載者:User

標籤:效果   設定   注意   origin   css   mat   size   -o   href   

css3動畫特效:上下晃動的div
<div id="square" class="container animated">上下晃動</div>   /** * transform-origin 設定旋轉元素的基點位置 * animation-name 設定動畫名稱 * animation-duration 設定動畫時間 * animation-fill-mode 設定播放後的狀態 * animation-iteration-count 設定迴圈播放的次數 * transition-timing-function: cubic-bezier 貝茲路徑效果,它有四個值,指在X軸與Y軸的兩個曲線的點,第一個點:X1 Y1;第二個點:X2 Y2 * transform: translate3d 設定動畫Z軸位移幾個元素,表示只在Z軸上移動 * * 需要注意:transform: translate3d 不等於 transform: translateZ */ .animated {  animation-duration: 1s; /*動畫時間*/  animation-fill-mode: both; /*播放後的狀態*/} .animated {  animation-iteration-count: infinite; /*動作迴圈的次數:infinite 無限迴圈*/} .animated {  animation-duration: 2s; /*動畫時間*/} .container {  background: #2D97DB;  width: 90%;  height: 90%;  padding: 100px;  margin: 20px auto;  font-family: "微軟雅黑";  font-size: 40px;  color: white;  text-align: center;  line-height: 90%;} .container:hover{  animation-name:container; /*動畫的名稱*/  transform-origin: center bottom; /*設定動畫旋轉元素的基點為:置中靠下*/  cursor: pointer;} @keyframes container{  0%,  100%,  20%,  50%,  80% {  transition-timing-function: cubic-bezier(0.215,.61,.355,1); /*貝茲路徑 : X1 Y1 X2 Y2*/  transform: translate3d(0,0,0); /*設定只在Z軸上移動*/  }  40%,  43%{  transition-timing-function: cubic-bezier(0.755,0.50,0.855,0.060);  transform: translate3d(0,-30px,0);  }  70%{  transition-timing-function: cubic-bezier(0.755,0.050,0.855,0.060);  transform: translate3d(0,-15px,0);  }  90%{  transform: translate3d(0,-4px,0);  }}

 

css3動畫特效:上下晃動的div

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.