<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="css/animate.css">
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<style>
.testa {
-webkit-animation: bounceIn 1s 1s;
}
.testb {
-webkit-animation: bounceIn 1s 2s;
}
.testc {
-webkit-animation: bounceIn 1s 3s;
}
.testd {
-webkit-animation: bounceIn 1s 4s;
}
dd:hover{
cursor: pointer;
color: orange;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<br>
<br>
<div class="col-lg-3 testa">hello world</div>
<div class="col-lg-3 testb">console.log</div>
<div class="col-lg-3 testc">document.write</div>
<div class="col-lg-3 testd">alert</div>
</div>
<br>
<hr>
<br>
<!-- <div class="row">
<input id="animationName" type="text">
<button id="addBtn">addClass</button>
</div> -->
<div class="row">
<div class="col-lg-12">
<h2 id="test">HELLO WORLD</h2>
</div>
<br>
<hr>
<br>
<div class="row">
<div class="col-lg-3">
<dl>
<dt>Attention(晃动效果)</dt>
<dd>bounce</dd>
<dd>flash</dd>
<dd>pulse</dd>
<dd>rubberBand</dd>
<dd>shake</dd>
<dd>headShake</dd>
<dd>swing</dd>
<dd>tada</dd>
<dd>wobble</dd>
<dd>jello</dd>
</dl>
</div>
<div class="col-lg-3">
<dl>
<dt>bounce(弹性缓冲效果)</dt>
<dd>bounceIn</dd>
<dd>bounceInDown</dd>
<dd>bounceInRight</dd>
<dd>bounceInUp</dd>
<dd>bounceOut</dd>
<dd>bounceOutDown</dd>
<dd>bounceOutLeft</dd>
<dd>bounceOutRight</dd>
<dd>bounceOutUp</dd>
</dl>
</div>
<div class="col-lg-3">
<dl>
<dt>fade(透明度变化效果)</dt>
<dd>fadeIn</dd>
<dd>fadeInDown</dd>
<dd>fadeInDownBig</dd>
<dd>fadeInLeftBig</dd>
<dd>fadeInRight</dd>
<dd>fadeInRightBig</dd>
<dd>fadeInUp</dd>
<dd>fadeInUpBig</dd>
<dd>fadeOut</dd>
<dd>fadeOutDown</dd>
<dd>fadeOutDownBig</dd>
<dd>fadeOutLeft</dd>
<dd>fadeOutLeftBig</dd>
<dd>fadeOutRight</dd>
<dd>fadeOutRightBig</dd>
<dd>fadeOutUp</dd>
<dd>fadeOutUpBig</dd>
</dl>
</div>
<div class="col-lg-3">
<dl>
<dt>flip(翻转效果)</dt>
<dd>flipInX</dd>
<dd>flipInY</dd>
<dd>flipOutX</dd>
<dd>flipOutY</dd>
</dl>
</div>
</div>
<div class="row">
<div class="col-lg-3">
<dl>
<dt>rotate(旋转效果)</dt>
<dd>rotateIn</dd>
<dd>rotateInDownLeft</dd>
<dd>rotateInDownRight</dd>
<dd>rotateInUpLeft</dd>
<dd>rotateInUpRight</dd>
<dd>rotateOut</dd>
<dd>rotateOutDownLeft</dd>
<dd>rotateOutDownRight</dd>
<dd>rotateOutUpLeft</dd>
<dd>rotateOutUpRight</dd>
</dl>
</div>
<div class="col-lg-3">
<dl>
<dt>slide(滑动效果)</dt>
<dd>slideInDown</dd>
<dd>slideInLeft</dd>
<dd>slideInRight</dd>
<dd>slideInUp</dd>
<dd>slideOutDown</dd>
<dd>slideOutLeft</dd>
<dd>slideOutRight</dd>
<dd>slideOutUp</dd>
</dl>
</div>
<div class="col-lg-3">
<dl>
<dt>zoom(变焦效果)</dt>
<dd>zoomIn</dd>
<dd>zoomInDown</dd>
<dd>zoomInLeft</dd>
<dd>zoomInRight</dd>
<dd>zoomInUp</dd>
<dd>zoomOut</dd>
<dd>zoomOutDown</dd>
<dd>zoomOutLeft</dd>
<dd>zoomOutRight</dd>
<dd>zoomOutUp</dd>
</dl>
</div>
<div class="col-lg-3">
<dl>
<dt>special(特殊效果)</dt>
<dd>hinge</dd>
<dd>rollIn</dd>
<dd>rollOut</dd>
<dd>lightSpeedIn</dd>
<dd>lightSpeedOut</dd>
</dl>
</div>
</div>
</div>
</div>
<script>
$(function () {
// $("#addBtn").click(function () {
// var animationName = $("#animationName").val();
// $("#test").removeClass().addClass(animationName + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
// $(this).removeClass();
// })
// })
$("dd").click(function(){
var animationName = $(this).html();
$("#test").removeClass().addClass(animationName + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
$(this).removeClass();
})
})
})
</script>
</body>
</html>
css动画插件 - animation.css的基本使用
最新推荐文章于 2022-11-21 13:16:59 发布