Animate.css介紹

Animate.css簡(jiǎn)介

animate.css 動(dòng)畫庫(kù),預(yù)設(shè)了抖動(dòng)(shake)、閃爍(flash)、彈跳(bounce)、翻轉(zhuǎn)(flip)、旋轉(zhuǎn)(rotateIn/rotateOut)、淡入淡出(fadeIn/fadeOut)等多達(dá) 60 多種動(dòng)畫效果,幾乎包含了所有常見的動(dòng)畫效果。

Animate.css官網(wǎng)

官網(wǎng)

Animate.css安裝

npm install animate.css

Animate模板

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <!-- 引用animate文件 -->
  <link rel="stylesheet" href="css/animate.min.css"/>
</head>
<body>

</body>
</html>
  • 添加一個(gè)動(dòng)畫
<!-- animated類似與全局變量,定義動(dòng)畫持續(xù)時(shí)間 -->
<!-- bounce具體動(dòng)畫的名稱 -->
<div class="animated bounce">
  Animate.css
</div>
  • 定義播放次數(shù)
<!-- infinite定義動(dòng)畫無(wú)限播放 -->
<div class="animated bounce infinite">
  Animate.css
</div>
  • 通過(guò)JavaScript或jQuery添加Animate動(dòng)畫

<div>
  Animate.css
</div>
<!-- 在線引用jQuery文件 -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<!-- 通過(guò)jQuery添加animate動(dòng)畫 -->
<script> $('div').addClass('animated bounce'); </script></pre>
  • 添加定時(shí)器,5秒后刪除animate無(wú)限播放效果

<div>
  Animate.css
</div>
<!-- 在線引用jQuery文件 -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<!-- 通過(guò)JavaScript或jQuery添加animate動(dòng)畫 -->
<script> $('div').addClass('animated bounce infinite');
   setTimeout(function(){
     $("div").removeClass("infinite");
   },5000) </script></pre>

同類型動(dòng)畫庫(kù)推薦

GreenSock (TweenMax)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容