english 
Thread Options  Search this Thread  
Post: #1
20-12-2006 15:17 PM (This post was last modified: 20-12-2006 18:01 PM by lasha12345)
lasha12345


Joined: 14-11-2006
Posts: 89
Country: Burkina Faso
Male lasha12345 is Offline now
snow script :D
snow script

CODE:
<script language=JavaScript1.2>

var snowsrc=""
var no = 10;
var ns4up = (document.layers) ? 1 : 0; 
var ie4up = (document.all) ? 1 : 0;

var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 1200;


dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();

for (i = 0; i < no; ++ i) { 
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name="dot"+ i +"" left="15" top="15" visibility="show"><img src='"+snowsrc+"' border="0"></layer>");
} else {
document.write("<layer name="dot"+ i +"" left="15" top="15" visibility="show"><img src='"+snowsrc+"' border="0"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id="dot"+ i +"" style="POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;"><img src='"+snowsrc+"' border="0"></div>");
} else {
document.write("<div id="dot"+ i +"" style="POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;"><img src='"+snowsrc+"' border="0"></div>");
}
}
}

function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", 10);
}

function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();

}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", 10);
}

if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
</script>


put this in the botton of functions.php
 
  here is image and put image link
CODE:
var snowsrc=""

  here   ))

enjoy

Post: #2
20-12-2006 17:14 PM
KaleR


Joined: 12-11-2006
Posts: 210
Country: United Kingdom
Male KaleR is Offline now
snow script :D
do i need snow.gif pic is well ?

cause i think yes :S

sorry for that

Post: #3
20-12-2006 18:02 PM
lasha12345


Joined: 14-11-2006
Posts: 89
Country: Burkina Faso
Male lasha12345 is Offline now
snow script :D
sorry i there was a mistace with BB code i fixed it enjoy!

Post: #4
20-12-2006 20:23 PM
KaleR


Joined: 12-11-2006
Posts: 210
Country: United Kingdom
Male KaleR is Offline now
snow script :D
hehe

Thanks m8

how can i get more different colors of snow ?

and what about few different color snows at same time

btw this is nice

Quick Reply
Decrease Size
Increase Size
Insert bold text Insert italic text Insert underlined text Align text to the left Align text to the centerr Align text to the right Justify text Insert quoted text Code Insert formatted PHP code Insert formatted SQL code
Colors
Insert hyperlink Insert image Insert email address
Smilies
Insert hidden text



Forum Jump: