Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] 一个非常漂亮的网页特效,雪花,下雪了!

[复制链接]
haicer 发表于 2012-12-28 16:28:45 | 显示全部楼层 |阅读模式

给你一个很漂亮的,源程序也很短。把下面那段放进BODY就行了。可以放在头部,也可以放在尾部,也可以自己见一个DIY静态。。放在里面!

演示地址:www.t5200.com
  1. <style>
  2. .drop { position: absolute; width: 3;  filter: flipV(), flipH(); font-size: 40; color: blue }
  3. </style>
  4. <script language="javascript">

  5. snow = false;    // false-rain;   true-snow
  6. snowsym = " * "  //These are the symbols for each
  7. rainsym = " * "  //You can put images here.
  8. howmany = 15     //How many drops/snowflakes?

  9. /**************Do not need to change anything below***********/
  10. if(snow){sym = snowsym; speed=5; angle=6; drops=howmany}
  11. else{sym = rainsym; speed=3; drops=howmany; angle=6}
  12. movex = -speed/angle; movey = speed; count = 0;

  13. function moverain(){
  14. for(move = 0; move < drops; move++){
  15. xx[move]+=movex;  yy[move]+=mv[move];
  16. hmm = Math.round(Math.random()*1);
  17. if(xx[move] < 0){xx[move] = maxx+10;}
  18. if(yy[move] > maxy){yy[move] = 10;}
  19. drop[move].left = xx[move]
  20. drop[move].top = yy[move]+document.body.scrollTop;
  21. }setTimeout('moverain()','1')}

  22. </script>
  23. <script language="javascript">

  24. if (document.all){
  25. drop = new Array(); xx = new Array(); yy = new Array(); mv = new Array()
  26. ly = "document.all[\'"; st = "\'].style"
  27. for(make = 0; make < drops; make++){
  28. document.write('<div id="drop'+make+'" class=drop>'+sym+'</div>');
  29. drop[make] = eval(ly+'drop'+make+st);
  30. maxx = document.body.clientWidth-40
  31. maxy = document.body.clientHeight-40
  32. xx[make] = Math.random()*maxx;
  33. yy[make] = -100-Math.random()*maxy;
  34. drop[make].left = xx[make]
  35. drop[make].top = yy[make]
  36. mv[make] = (Math.random()*5)+speed/16;
  37. drop[make].fontSize = (Math.random()*10)+20;
  38. if(snow){col = '#336699'}else{col = 'green'}
  39. drop[make].color = col;
  40. }
  41. window.onload=moverain
  42. }
  43. </script>
复制代码
 楼主| haicer 发表于 2012-12-28 16:29:09 | 显示全部楼层
沙发!~~~~~~~~~~~~~自己占了。。。呼呼!!!!!!!!!加油!!!!!!!!!!!
回复

使用道具 举报

啊是的撒 发表于 2013-1-7 00:22:31 | 显示全部楼层
看贴回帖是一种美德
回复

使用道具 举报

无效楼层,该帖已经被删除
yao_512 发表于 2013-5-24 13:30:33 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

www.sohu.ir 发表于 2013-5-24 16:02:02 | 显示全部楼层
冬天用还是夏天用
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-10-4 17:18 , Processed in 0.100840 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表