Animate.css动画效果演示
http://www.jq22.com/yanshi819
引入animate.css的几种方法
官网下载地址:
https://raw.github.com/daneden/animate.css/master/animate.css
或者使用在线cdn:
https://unpkg.com/animate.css@3.5.2/animate.min.css
使用方法
Animate.css是把不同的动画绑定到了不同的类里,所以想要使用哪种动画,只需要把通用类animated和相应的类添加到元素上就行了。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<link rel="stylesheet" href="https://unpkg.com/animate.css@3.5.2/animate.min.css" type="text/css" />
<style>
.box{height: 100px;width: 100px;background-color: lightblue}
</style>
</head>
<body>
<div class="box animated bounce"></div><!--直接在元素上添加animated和对应的类名即可-->
</body>
</html>
animate.css主要包括Attention(晃动效果)、bounce(弹性缓冲效果)、fade(透明度变化效果)、flip(翻转效果)、rotate(旋转效果)、slide(滑动效果)、zoom(变焦效果)、special(特殊效果)这8类。
通过自定义动画的配置参数,比如动画持续时间,动画的执行次数等等,以达到增强动画效果的目的。
.box{
height: 100px;
width: 100px;
background-color: lightblue;
animation-duration: 3s;/*动画持续时间*/
animation-delay: 2s;/*动画执行延迟时间*/
animation-iteration-count: 3;/*动画执行次数*/
}