码迷,mamicode.com
首页 > 其他好文 > 详细

九九九的动画特效

时间:2017-08-20 00:41:08      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:asc   osi   on()   特效   height   func   var   his   auto   

 

自行导入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>

九九九的动画特效

标签:asc   osi   on()   特效   height   func   var   his   auto   

原文地址:http://www.cnblogs.com/cutenana/p/7398322.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!