We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ ! ] Snow Falling Code
Topic Started: Dec 8 2012, 11:23 PM (1,457 Views)
ThatGirlJazz
Member
[ * ]
Board Address: http://s3.zetaboards.com/The_Charmed_Academy/
Board Software: ZetaBoards
Description: I want my code to have snow falling on my board.
Offline Profile Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
Okay. Well I recommend a dark skin if you want to use this code. Otherwise it won't have such of a great effect.

Step one
Place this into the Javascript section of your board.
Code:
 
$("body").attr("onLoad","snow()");


Step two
Place this Below the board.
Code:
 
<script
language="JavaScript"> <!-- Snow Script by kurt.grigg@virgin.net
--> <!-- Distributed by http://www.hypergurl.com N = 40; Y = new Array();
X = new Array(); S = new Array(); A = new Array(); B = new Array(); M = new Array();
V = (document.layers)?1:0; iH=(document.layers)?window.innerHeight:window.document.body.clientHeight;
iW=(document.layers)?window.innerWidth:window.document.body.clientWidth; for (i=0;
i < N; i++){ Y[i]=Math.round(Math.random()*iH); X[i]=Math.round(Math.random()*iW);
S[i]=Math.round(Math.random()*5+2); A[i]=0; B[i]=Math.random()*0.1+0.1; M[i]=Math.round(Math.random()*1+1);
} if (V){ for (i = 0; i < N; i++) {document.write("<LAYER NAME='sn"+i+"'
LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,"+M[i]+","+M[i]+"'></LAYER>")}
} else{ document.write('<div style="position:absolute;top:0px;left:0px">');
document.write('<div style="position:relative">'); for (i = 0;
i < N; i++) {document.write('<div id="si" style="position:absolute;top:0;left:0;width:'+M[i]+';height:'+M[i]+';background:#fffff0;font-size:'+M[i]+'"></div>')}
document.write('</div></div>'); } function snow(){ var H=(document.layers)?window.innerHeight:window.document.body.clientHeight;
var W=(document.layers)?window.innerWidth:window.document.body.clientWidth; var
T=(document.layers)?window.pageYOffset:document.body.scrollTop; var L=(document.layers)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < N; i++){ sy=S[i]*Math.sin(90*Math.PI/180); sx=S[i]*Math.cos(A[i]);
Y[i]+=sy; X[i]+=sx; if (Y[i] > H){ Y[i]=-10; X[i]=Math.round(Math.random()*W);
M[i]=Math.round(Math.random()*1+1); S[i]=Math.round(Math.random()*5+2); } if (V){document.layers['sn'+i].left=X[i];document.layers['sn'+i].top=Y[i]+T}
else{si[i].style.pixelLeft=X[i];si[i].style.pixelTop=Y[i]+T} A[i]+=B[i]; } setTimeout('snow()',10);
} //--> </script>


If this doesn't work then let me know. I got the code from :: http://www.hypergurl.com/snowpage.html
Offline Profile Goto Top
 
ThatGirlJazz
Member
[ * ]
I put it in like you said and we have a dark skin for Christmas, so I chose that and it didn't show up. Thanks for the help though! I had found one that had a javascript file you had to upload and I didn't think that was allowed on ZB, so I skipped it.
Edited by ThatGirlJazz, Dec 9 2012, 04:18 PM.
Offline Profile Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
Sorry, may have been my fault. Put this in Javascripts. If it won't work there, try the top of the Below the board section.
Code:
 

<script type="text/javascript">$("body").attr("onLoad","snow()");</script>
Offline Profile Goto Top
 
ThatGirlJazz
Member
[ * ]
I tried both and nothing. Thanks for the continued help though!
Edited by ThatGirlJazz, Dec 10 2012, 05:34 PM.
Offline Profile Goto Top
 
Moonface
Member Avatar


This request has gone a lengthy period of time without any new activity, therefore it is being marked as expired. This means that the request was typically too time-consuming or irritating for coders (who provide this service voluntarily in their free time) to complete.

Thank you.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Join the millions that use us for their forum communities. Create your own forum today.
Learn More · Register for Free
« Previous Topic · Closed Requests · Next Topic »
Locked Topic