效果
https://daneden.github.io/animate.css/?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>animate动画</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/animate.css/3.7.2/animate.min.css">
</head>
<style>
.wrap {
width: 260px;
height: 200px;
background: url("https://sucai.suoluomei.cn/sucai_zs/images/20191227164612-2020yunshi.png");
margin: 50px;
display: none;
}
.btn {
width: 200px;
height: 50px;
text-align: center;
line-height: 50px;
background: lightseagreen;
color: #fff;
cursor: pointer;
}
</style>
<body>
<div class="btn">点击动画</div>
<div class="wrap"></div>
</body>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script>
$(function () {
$.fn.extend({
animateCss: function (animationName) {
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
$(this).addClass('animated ' + animationName).one(animationEnd, function () {
$(this).removeClass('animated ' + animationName);
});
}
});
$('.btn').on('click', function () {
$('.wrap').css("display","block")
$('.wrap').animateCss('rotateIn');
});
});
</script>
</html>