help with snow code [solved]

Go down

help with snow code [solved] Empty help with snow code [solved]

Post by The Boss on December 26th 2006, 1:04 am

i have this snow code but it wont work on my site i put this in the hompage part of admin then press the a button can some please tell me why it wont work

</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>

got this code from http://www.hypergurl.com/snowpage.html



thanks in advance


Last edited by pauldemonteverde on December 28th 2006, 1:41 pm; edited 1 time in total
avatar
The Boss
Forumember

Male Posts : 28
Reputation : 0
Language : english
Location : ffff

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by pauldemonteverde on December 26th 2006, 4:46 am

this is an another option, you can visit, http://www.dynamicdrive.com for some scripts.

■ make sure you have the snow script, example:

/!\This is just an script example/!\
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin
var no = 12; // snow number
var speed = 25; // smaller number moves the snow faster
var snowflake = "http://www.freewebtown.com/paulmonteverde/images/image.gif";

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
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 = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
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\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></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;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" 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();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
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()", speed);
}
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();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
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()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// End -->
</SCRIPT>

■ Open your snow script on a NotePad or any text editing tool.

■ Delete/Remove the text in color blue.

Save As your snow script as SNOW.js

■ Upload your snow script to any web hosting. (e.g., www.freewebtown.com or www.freespaces.com)

■ get your snow URL (e.g., www.freewebtown.com/USERNAME_or_ACCOUNT/SNOW.js)

■ now with this code, replace your SNOW_URL with your snow URL
<script type=text/javascript src=SNOW_URL></script>

■ Go to:

Admin Panel >> General Admin >> Configuration >> General

■ Put the codes in the SITE DESCRIPTION. The codes should look like this:
<script type=text/javascript src=http://www.freewebtown.com/username/SNOW.js></script>

■ Save it.

WORDS TO KNOW:
HOST or HOSTING: To Upload or save files on internet.
Some sites you can host your files:
http://www.freewebtown.com
http://www.freespaces.com
http://geocities.yahoo.com

URL: (Uniform Resource Locator)
an address identifying the location of a file on the Internet,
consisting of the protocol,
the computer on which the file is located,
and the file’s location on that computer.
pauldemonteverde
pauldemonteverde
Forumember

Male Posts : 238
Reputation : 9
Language : English and Filipino
Location : Pilipinas

http://isanghimig.online-talk.net

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by The Boss on December 26th 2006, 2:04 pm

i dont understand how to use www.freewebtown.com i have sign up and uploaded a file but where is the addy to put on my site
avatar
The Boss
Forumember

Male Posts : 28
Reputation : 0
Language : english
Location : ffff

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by pauldemonteverde on December 27th 2006, 2:48 am

if you used freewebtown, you can see your file at the File Manager.
to get your full URL,


whereas:

USERNAME is the account name you used to log-in at freewebtown.

if you are not familiar using freewebtown, you can try other web hosting site. you can search google for some good web hosting site.
pauldemonteverde
pauldemonteverde
Forumember

Male Posts : 238
Reputation : 9
Language : English and Filipino
Location : Pilipinas

http://isanghimig.online-talk.net

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by Cornelia on December 27th 2006, 10:21 am

You can also use this host which is very simple to use : http://pmsc.free.fr/gb

Then you choose the host for .js files, you upload and then, you will have one URL ready to use.

This host has been translated recently, so the addy can now be given.
Cornelia
Cornelia
Hyperactive

Female Posts : 4763
Reputation : 172
Language : I'M NOT A TECHIE OR A MOD, SO QUIT SENDING ME PMS FOR TECHIE STUFF OR LOST PASSWORDS !!!
Location : Absent on weekends until camping season ends

http://ishimaru-design.servhome.org

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by The Boss on December 27th 2006, 3:29 pm

i tried putting this url http://pmsc.free.fr/J/061227151010.js in the site description but nothing happens this is what it should like http://www.hypergurl.com/snowpage.html
avatar
The Boss
Forumember

Male Posts : 28
Reputation : 0
Language : english
Location : ffff

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by pauldemonteverde on December 27th 2006, 3:42 pm

put this code on the site description, go to:

Admin Panel >> General Admin >> Configuration >> Site description

Code:
<script type=text/javascript src="http://pmsc.free.fr/J/061227151010.js"></script>



update message:

sorry, you are using double html script.

try to look using only one script.



update message:

i tried to use your code, but there is an error on your script.
pauldemonteverde
pauldemonteverde
Forumember

Male Posts : 238
Reputation : 9
Language : English and Filipino
Location : Pilipinas

http://isanghimig.online-talk.net

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by The Boss on December 27th 2006, 4:12 pm

i even tried your script pauldemonteverde
but still dont work
avatar
The Boss
Forumember

Male Posts : 28
Reputation : 0
Language : english
Location : ffff

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by pauldemonteverde on December 27th 2006, 4:20 pm

the codes you had given is not applicable on the forum boards. you can use that codes only for/as web page. your codes uses the BODY onload command and BODY scripts of an html page. try looking for another scripts that uses only 1 script. i tested your codes it really dont work. let me know if you see some good codes.



update message:

to katt

the link you had given about hosting js file does not work.




update message:

to The Boss

use my code:

Code:
<script type=text/javascript src="http://www.freewebtown.com/friendstermagic3/snow.js"></script>
pauldemonteverde
pauldemonteverde
Forumember

Male Posts : 238
Reputation : 9
Language : English and Filipino
Location : Pilipinas

http://isanghimig.online-talk.net

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by The Boss on December 27th 2006, 4:29 pm

@pauldemonteverde wrote:the codes you had given is not applicable on the forum boards. you can use that codes only for/as web page. your codes uses the BODY onload command and BODY scripts of an html page. try looking for another scripts that uses only 1 script. i tested your codes it really dont work. let me know if you see some good codes.



update message:

to katt

the link you had given about hosting js file does not work.




update message:

to The Boss

use my code:

Code:
<script type=text/javascript src="http://www.freewebtown.com/friendstermagic3/snow.js"></script>
thanks for you code it works look www.freeunlocks4u.com

i have this one but cant get it to work mybe you might get some joy
<script type="text/javascript">

/******************************************
* Snow Effect Script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use
******************************************/

//Configure below to change URL path to the snow image
var snowsrc="snow.gif"
// Configure below to change number of snow to render
var no = 10;
// Configure whether snow should disappear after x seconds (0=never):
var hidesnowtime = 0;
// Configure how much snow should drop down before fading ("windowheight" or "pageheight")
var snowdistance = "pageheight";

///////////Stop Config//////////////////////////////////

var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

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

if (ns6up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = iecompattest().clientWidth;
doc_height = iecompattest().clientHeight;
}

dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" : snowsrc
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 (ie4up||ns6up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/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 snowIE_NS6() { // IE and NS6 main animation function
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
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.getElementById("dot"+i).style.top=yp[i]+"px";
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}
snowtimer=setTimeout("snowIE_NS6()", 10);
}

function hidesnow(){
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
}


if (ie4up||ns6up){
snowIE_NS6();
if (hidesnowtime>0)
setTimeout("hidesnow()", hidesnowtime*1000)
}

</script>
avatar
The Boss
Forumember

Male Posts : 28
Reputation : 0
Language : english
Location : ffff

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by pauldemonteverde on December 27th 2006, 4:40 pm

ok...

i have re-modify your snow code


use this code and paste it on your Site Description


Code:
<script type=text/javascript src="http://www.freewebtown.com/friendstermagic3/snow.js"></script>


see example of it at my forum
pauldemonteverde
pauldemonteverde
Forumember

Male Posts : 238
Reputation : 9
Language : English and Filipino
Location : Pilipinas

http://isanghimig.online-talk.net

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by The Boss on December 27th 2006, 5:31 pm

thank you so much for your help
avatar
The Boss
Forumember

Male Posts : 28
Reputation : 0
Language : english
Location : ffff

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by bizigidibizi on December 28th 2006, 9:28 pm

this excellent =) =) thnks thnks thnks thnks =) Smile
bizigidibizi
bizigidibizi
Forumember

Female Posts : 49
Reputation : 0
Language : Turkish
Location : Turkey

http://help.editboard.com

Back to top Go down

help with snow code [solved] Empty Re: help with snow code [solved]

Post by pauldemonteverde on December 29th 2006, 3:47 am

i locked this topic to avoid floods.
pauldemonteverde
pauldemonteverde
Forumember

Male Posts : 238
Reputation : 9
Language : English and Filipino
Location : Pilipinas

http://isanghimig.online-talk.net

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum