December 14, 2018, 01:35:48 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

[Code] Rain Without Image Links

Pages: [1]   Go Down
  Print  
Author Topic: [Code] Rain Without Image Links  (Read 267 times)
DzinestaR
Starter
Starter
Offline Offline

Gender: Male
Posts: 21


View Profile WWW
Badges: (View All)
« on: September 07, 2009, 10:16:11 pm »

Forum Url: http://SMFDesigns.smfforfree3.com

Code Demo.

Well theres a "Rain on forum" code here that requires you to get / make images well here's a similar code that requires NO images at all.

Add The Following code to your header.

Code:
<script src="jquery.js"></script>
<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 if needed.
howmany = 20     //How many drops.

/**************No Editing Required Below***********/
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[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>

Add The Following Code to your Footer.

Code:
<script language="javascript">
//Modified By DzinestaR

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/4;
drop[make].fontSize = (Math.random()*10)+20;
if(snow){col = 'white'}else{col = 'blue'}
drop[make].color = col;
}
window.onload=moverain
}
</script>

Enjoy.

-DzinestaR

Report Spam   Logged



Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum | Buy traffic for your forum/website

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy