自行导入js
<script type="text/javascript" src="js/jquery.min.js"></script>
<style>
.all {
width: 800px;
margin: 0 auto;
margin-top: 50px;
}
.one{
width:25px;
height:25px;
border-radius: 50px;
background-color: #e69696;
display: inline-block;
}
</style>
</head>
<body>
<div class="all">
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div>
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div>
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one" style="margin-left: 363px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one" style="margin-left: 363px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one" style="margin-left: 363px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one" style="margin-left: 363px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div>
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div>
<div class="ones">
<div class="one" style="margin-left:429px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one" style="margin-left:429px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one" style="margin-left:429px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one" style="margin-left:429px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one" style="margin-left:429px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one" style="margin-left:429px;"></div>
<div class="one"></div>
</div>
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div>
<div class="ones">
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div class="one"></div>
<div>
</div>
<script>
$(function() {
animate();
function animate() {
$(‘.one‘).each(function() {
$(this).css({
position: ‘relative‘,
top: ‘-400px‘,
opacity: 0
});
var time = Math.floor((Math.random() * 3000) + 1);
$(this).delay(time).animate({
top: ‘10px‘,
opacity: 1
}, 2000, function() {
$(this).delay(time).animate({
top: ‘10px‘,
opacity: 0
}, 1000, function() {
$(this).delay(time).animate({
top: ‘0px‘,
opacity: 1
}, 500);
});
});
});
}
});
</script>