Page 1 of 1

js: snow code

Posted: Sun Dec 21, 2003 3:22 pm
by Hirchart
I like this snow alot, and my band site is so boring, so can anyone tell me what the code is for this cuddley snow on my screen ?:)

Posted: Sun Dec 21, 2003 3:23 pm
by Den

Code: Select all

<style> 

.drop { position: absolute; width: 3;  filter: flipV(), flipH(); font-size: 8; color: blue } 

</style>

<script language="javascript"> 

snow = true;    // false-rain;   true-snow 

snowsym = " * "  //These are the symbols for each 

rainsym = " ' "  //You can put images here. 

howmany = 10     //How many drops/snowflakes? 



/**************Do not need to change anything below***********/ 

if(snow){sym = snowsym; speed=1; angle=10; drops=howmany} 

else{sym = rainsym; speed=10; 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="JavaScript1.2">



function high(which2){

theobject=which2

highlighting=setInterval("highlightit(theobject)",50)

}

function low(which2){

clearInterval(highlighting)

which2.filters.alpha.opacity=20

}







function highlightit(cur2){

if (cur2.filters.alpha.opacity<100)

cur2.filters.alpha.opacity+=5

else if (window.highlighting)

clearInterval(highlighting)

}



</script>

Posted: Mon Dec 22, 2003 4:43 am
by Hirchart
tnx :)