永发信息网

下雪代码。。

答案:2  悬赏:0  手机版
解决时间 2021-04-12 20:27
  • 提问者网友:轻浮
  • 2021-04-12 03:51
下边是段下雪的代码,不过下的是绿色的雪,丑倒。那个哥们能帮我改成白色的呢?谢谢了。
<style>
.drop { position: absolute; width: 3; filter: flipV(), flipH(); font-size: 40; color: blue }
</style>
<script language="javascript">

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


if(snow){sym = snowsym; speed=15; angle=6; drops=howmany}
else{sym = rainsym; speed=3; drops=howmany; angle=6}
movex = -speed/angle; movey = speed; count = 0;

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

</script>
<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[make] = eval(ly+'drop'+make+st);
maxx = document.body.clientWidth-40
maxy = document.body.clientHeight-40
xx[make] = Math.random()*maxx;
yy[make] = -100-Math.random()*maxy;
drop[make].left = xx[make]
drop[make].top = yy[make]
mv[make] = (Math.random()*5)+speed/16;
drop[make].fontSize = (Math.random()*10)+20;
if(snow){col = '#000000'}else{col = 'green'}
drop[make].color = col;
}
window.onload=moverain
}
</script>
最佳答案
  • 五星知识达人网友:第四晚心情
  • 2021-04-12 04:48
col = 'green'
改成
col = '#fff'

不过网页背景得是黑的,不然你看不到白雪
全部回答
  • 1楼网友:雪起风沙痕
  • 2021-04-12 05:11

全屏幕下雪的vb代码,单击鼠标结束下雪代码如下,只需把它复制到form中即可:

dim snow(1000, 2), amounty as integer

private sub form_mousedown(button as integer, shift as integer, x as single, y as single) unload me end sub

private sub form_load() form1.backcolor = vbblack form1.borderstyle = 0 form1.windowstate = 2 form1.show doevents randomize amounty = 325 for j = 1 to amounty snow(j, 0) = int(rnd * form1.width) snow(j, 1) = int(rnd * form1.height) snow(j, 2) = 10 + (rnd * 20) next j do while not (doevents = 0) for ls = 1 to 10 for i = 1 to amounty oldx = snow(i, 0): oldy = snow(i, 1) snow(i, 1) = snow(i, 1) + snow(i, 2) if snow(i, 1) > form1.height then snow(i, 1) = 0: snow(i, 2) = 5 + (rnd * 30) snow(i, 0) = int(rnd * form1.width) oldx = 0: oldy = 0 end if coloury = 8 * (snow(i, 2) - 10): coloury = 60 + coloury pset (oldx, oldy), qbcolor(0) pset (snow(i, 0), snow(i, 1)), rgb(coloury, coloury, coloury) next i next ls loop end end sub

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯