<!DOCTYPE html>
<html>
<head>
<title>demo</title>
</head>
<style>
*{
padding: 0;
margin: 0;
}
body{
width: 100%;
height: 100%;
background: #f5f5f5;
}
#container{
width: 960px;
margin: 10em auto;
}
#container .content{
width: 25%;
height: 200px;
float: left;
text-align: center;
padding:10px;
margin: 10px;
background: #abcdef;
border: 1px solid #000;
-webkit-animation-name: card-in;
-webkit-animation-duration: .5s;
animation-name: card-in;
animation-duration: .5s;
}
@-webkit-keyframes card-in {
from {
opacity: 0;
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
to {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
}
@keyframes card-in {
from {
opacity: 0;
-webkit-transform: scale(1.3);
transform: scale(1.3);
}
to {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
}
</style>
<body>
<div id="container">
<div class="content">123465798</div>
<div class="content">123465798</div>
<div class="content">123465798</div>
<div class="content">123465798</div>
<div class="content">123465798</div>
<div class="content">123465798</div>
<div class="content">123465798</div>
<div class="content">123465798</div>
<div class="content">123465798</div>
</div>
</body>
</html>
#container .content{
width: 25%;
height: 200px;
float: left;
text-align: center;
padding:10px;
margin: 10px;
background: #abcdef;
border: 1px solid #000;
}
#container .content.start{
-webkit-animation-name: card-in;
-webkit-animation-duration: .5s;
animation-name: card-in;
animation-duration: .5s;
}
$(function(){
var $content = $('.content');
for (var i = 0; i < $content.length; i++) {
(function($this,i){
setTimeout(function(){
$this.addClass('start');
},i*100)
})($($content[i]),i)
};
})
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。