***综合类***javascript的下雨效果,比flash的下雨效果还好
把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件<html>
<head>
<style>
.drop { position: absolute; width: 3;filter: flipv(), fliph();
font-size: 40; color: blue }
</style>
<script language="javascript">
snow = false; // false-雨; true-雪
snowsym = " * "//这是符号
rainsym = " ' "//这儿可以放图片.
howmany = 10 //雨滴多少/雪片?
/**************不要给变下面的参数***********/
if(snow){sym = snowsym; speed=1; angle=10; drops=howmany}
else{sym = rainsym; speed=50; drops=howmany; angle=6}
movex = -speed/angle; movey = speed; count = 0;
function moverain(){
for(move = 0; move < drops; move++){
xx+=movex;yy+=mv;
hmm = math.round(math.random()*1);
if(xx < 0){xx = maxx+10;}
if(yy > maxy){yy = 10;}
drop.left = xx
drop.top = yy+document.body.scrolltop;
}settimeout('moverain()','1')}
</script>
</head>
<body bgcolor=#000000>
<script language="javascript">
if (document.all){
drop = new array(); xx = new array(); yy = new array(); mv = new
array()
ly = "document.all[\'"; st = "\'].style"
for(make = 0; make < drops; make++){
document.write('<div id="drop'+make+'" class=drop>'+sym+'</div>');
drop = eval(ly+'drop'+make+st);
maxx = document.body.clientwidth-40
maxy = document.body.clientheight-40
xx = math.random()*maxx;
yy = -100-math.random()*maxy;
drop.left = xx
drop.top = yy
mv = (math.random()*5)+speed/4;
drop.fontsize = (math.random()*10)+20;
if(snow){col = 'white'}else{col = 'blue'}
drop.color = col;
}
window.onload=moverain
}
</script>
</body>
</html>
<td height="27" bgcolor="#ffffff"
--------------------------------------
http://www.huoyue.com.cn 活跃网,活跃人群的论坛,访问活跃网,将给您带来意想不到的收获,还可以免费为您开论坛,让您免费拥有与朋友、网友交流的论坛。你是年轻人吗?你活跃你就上!
页:
[1]