SMF For Free Support Forum
Signup For Free Forum
October 06, 2008, 09:11:46 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [Code] Rain  (Read 244 times)
0 Members and 1 Guest are viewing this topic.
Supernovadelta
SMF For Free Full Member
*
Offline Offline

Posts: 106


Supernovadelta Productions.


View Profile WWW
« on: June 16, 2008, 01:23:02 am »

                                                     Rain
This is another Java Script,and this will make your site start raining.You can edit the color,but its blue anyway.
Here is a preview:
http://i31.tinypic.com/4t7kld.jpg
Here is the code,just remember that this code can be used as header or footers.Its better if you put both.
Code:
<!-- this script got from www.javascriptfreecode.com -->

<body>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var no = 50;
var speed = 1;
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var s, x, y, sn, cs;
var a, r, cx, cy;
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
else
if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
x = new Array();
y = new Array();
r = new Array();
cx = new Array();
cy = new Array();
s = 8;
for (i = 0; i < no; ++ i) {
initRain();
if (ns4up) {
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
document.write(",</font></layer>");
}
else {
document.write("<layer name=\"dot"+ i +"\" left=\"1\" ");
document.write("top=\"1\" visibility=\"show\"><font color=\"blue\">");
document.write(",</font></layer>");
   }
}
else
if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
document.write(",</font></div>");
}
else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><font color=\"blue\">");
document.write(",</font></div>");
      }
   }
}
function initRain() {
a = 6;
r[i] = 1;
sn = Math.sin(a);
cs = Math.cos(a);
cx[i] = Math.random() * doc_width + 1;
cy[i] = Math.random() * doc_height + 1;
x[i] = r[i] * sn + cx[i];
y[i] = cy[i];
}
function makeRain() {
r[i] = 1;
cx[i] = Math.random() * doc_width + 1;
cy[i] = 1;
x[i] = r[i] * sn + cx[i];
y[i] = r[i] * cs + cy[i];
}
function updateRain() {
r[i] += s;
x[i] = r[i] * sn + cx[i];
y[i] = r[i] * cs + cy[i];
}
function raindropNS() {
for (i = 0; i < no; ++ i) {
updateRain();
if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
makeRain();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
document.layers["dot"+i].top = y[i];
document.layers["dot"+i].left = x[i];
}
setTimeout("raindropNS()", speed);
}
function raindropIE() {
for (i = 0; i < no; ++ i) {
updateRain();
if ((x[i] <= 1) || (x[i] >= (doc_width - 20)) || (y[i] >= (doc_height - 20))) {
makeRain();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
document.all["dot"+i].style.pixelTop = y[i];
document.all["dot"+i].style.pixelLeft = x[i];
}
setTimeout("raindropIE()", speed);
}
if (ns4up) {
raindropNS();
}
else
if (ie4up) {
raindropIE();
}
//  End -->
</script>
</body>
<font face="Tahoma"><a target="_blank" href="http://www.javascriptfreecode.com/"><span style="font-size: 8pt; text-decoration: none">JavaScript Free Code</span></a></font>

If there is any questions regarding the raining code,please comment.

Thank you for your time.
« Last Edit: June 16, 2008, 12:28:32 pm by simply sibyl » Logged

software
SMF For Free Newbie
*
Offline Offline

Posts: 7


View Profile
« Reply #1 on: June 16, 2008, 12:19:00 pm »

U taked all these codes from site i dont now remember what it was but theres all the codes youre posted so get a life leecher.
Logged
simply sibyl
Global Moderator
*
Online Online

Posts: 8407



View Profile WWW
« Reply #2 on: June 16, 2008, 12:21:28 pm »

U taked all these codes from site i dont now remember what it was but theres all the codes youre posted so get a life leecher.

software we do NOT allow harassment nor flaming members here.  SMF for Free Forum Rules
Should you have an issue with a post here in the future use the Report to Moderator Link.
   
Codes posted in this section do not need to be made by the person posting them.
It is perfectly okay to post a code that you find on the net here so that others can use it too.
We only ask that if you do post a code that you found someplace else on the net that you do NOT claim that you made it yourself.

« Last Edit: June 16, 2008, 12:26:47 pm by simply sibyl » Logged

Supernovadelta
SMF For Free Full Member
*
Offline Offline

Posts: 106


Supernovadelta Productions.


View Profile WWW
« Reply #3 on: June 16, 2008, 11:41:13 pm »

I'm sorry if i (Copy and Pasted) But i know what the codes mean.So basicly if somebody needs any help,i can assist them.
Logged



Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
ServerBeach Coupon
Page created in 0.483 seconds with 17 queries.