[Java教程]实现雪花飘落效果
0
2016-11-02 21:00:17
雪花飘落body{background:#000;background: url(http://www.wallcoo.com/holiday/Christmas%20Night%20at%20Disneyland/wallpapers/1280x800/Disneyland%20Sleeping%20Beauty%20Castle%20at%20night.jpg) no-repeat center 0 #000;}
.snowbg{width:1000px;height:600px;clear:both;margin:0 auto;position:relative;overflow:hidden;}
.snow{position:absolute;top:0;color:#fff;}
$(function(){
var d="
setInterval(function(){
var f=$(document).width();
var e=Math.random()*f-100;
var o=0.3+Math.random();
var fon=10+Math.random()*30;
var l = e - 100 + 200 * Math.random();
var k=2000 + 5000 * Math.random();
$(d).clone().appendTo(".snowbg").css({
left:e+"px",
opacity:o,
"font-size":fon,
}).animate({
top:"400px",
left:l+"px",
opacity:0.1,
},k,"linear",function(){$(this).remove()})
},200)
})
//欢迎交流讨论
本文网址:http://www.shaoqun.com/a/262823.html
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:admin@shaoqun.com。
0