PDA

View Full Version : Could someone please help me and tell me what is wrong with my script



Lillyvo
08-17-2005, 03:08 AM
IM trying to add the snow flake script but its not working could someone pleaseee look at this and tell me what is wrong?????

<HTML>
<HEAD>
<TITLE>Curls and Crowns Presents</TITLE>
</HEAD>
<BODY><script language="JavaScript1.2">

/******************************************
* Snow Effect Script- By Altan d.o.o. (snow@altan.hr, http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive (http://www.dynamicdrive.com/) for full source code
* Modified Dec 31st, 02' by DD. This notice must stay intact for use
******************************************/


//Configure below to change URL path to the snow image
var snowsrc="http://trinityfaye.com/snow.gif"
// Configure below to change number of snow to render
var no = 10;

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!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||ns6up) {
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\" top=\"15\" visibility=\"show\"><a href=\"http://dynamicdrive.com/\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src='"+snowsrc+"' border=\"0\"><\/layer>");
}
} else 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 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()", 10);
}

function snowIE_NS6() { // IE and NS6 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 = ns6up?window.innerWidth : document.body.clientWidth;
doc_height = ns6up?window.innerHeight : document.body.clientHeight;
}
dx[i] += stx[i];
if (ie4up){
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
else if (ns6up){
document.getElementById("dot"+i).style.top=yp[i];
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i]);
}
}
setTimeout("snowIE_NS6()", 10);
}

if (ns4up) {
snowNS();
} else if (ie4up||ns6up) {
snowIE_NS6();
}

</script><BR>


<center>
<b>

<Font Size="5" Face="Rockwell Extra Bold" color="red"><Marquee width=100% behavior=alternate>~*~Are You At The Top Of Santa's List?!~*~</marquee></Font><br><center><a href="mailto: CROWNUS1@BELLSOUTH.NET ? subject="I SAW YOUR BANNER"><img src="http://hometown.aol.com/tabtrot/myhomepage/ggcrown%20banner.jpg?mtbrand=AOL_US"></a></center>

</font></CENTER></font></font><BR></A><BR>

<P><font size=+3></font></a href=>


</a></center><p><Font Size="5" Face="Formal1436 BT" Font color="Red">


<center></a><a><BR>Yolonda Buuck </a><BR><font face="Moderne" size="4" Font color="Red">





**November 25 & 26 2005 **



Lafayette LA*** Holiday Inn Holidome***337-233-6815*** Room Rate $65




********

PARENTS Check out this Christmas Special!!

"Supreme Package $150"

Enter by November 15th and you a friend can enter for the price of one!!!

(entries must be received in the same envelope)

(INCLUDES BEAUTY, CASUALWEAR, ULTIMATE GRAND SUPREME, GRAND SUPREME AND MINI SUPREME)

PHOTOGENIC IS OPTIONAL, PHOTOGENIC IS NOT MANDATORY AND IS NOT NECESSARY FOR ANY AWARDS

*******

This Means you pay only

$75.00 for the Supreme Package!

*******

***1 Ultimate Grand Supreme***

$1500 BOND

FUR TRIMMED ROBE, CROWN, MONOGRAMMED BANNER, AND "SANTA'S SACK" OF GIFTS

****

***3 GRAND SUPREME QUEENS***

$1000.00 BOND

FUR TRIMMED ROBE, CROWN, MONOGRAMMED BANNER, AND "SANTA'S SACK" OF GIFTS

******************

*** 3 MINI SUPREME QUEENS***

$500.00 BOND

FUR TRIMMED ROBE, CROWN, MONOGRAMMED BANNER AND "SANTA'S SACK" OF GIFTS

******************

***1 GRAND TALENT WINNER***

$200.00 BOND

FUR TRIMMED ROBE, CROWN , AND MONOGRAMMED BANNER

***************************

***13 DIVISIONAL QUEENS***

FUR TRIMMED ROBE, CROWN, MONOGRAMMED BANNER, AND "SANTA'S SACK" OF GIFTS

***********

***52 ALTERNATES***

ALL ALTERNATES WILL ALSO RECEIVE "SANTA'S SACK" OF GIFTS

(NOONE WILL BE LEFT OUT)

*********************

***CHRISTMAS PARTY FRIDAY NIGHT***

Everyone is invited to "The Best Christmas Party"

ever. Have your pictures taken with SANTA!!!

All proceeds will be donated to the "Food For Families Food Drive"

$ 1000.00 donated in the last 4 years!

Experience the Real Meaning of Christmas....



<center>
<b>
<marquee behavior="alternate"scrollamount="7"></font face></font color></font size>
<font color="Green"><font face="Rockwell Extra Bold" size="7">~*BOOK NOW!*~</font face></font color></font size></marquee>
</marquee></font face></font color></font size>
<font color="Red"><font face="English111 Presto BT" size="3">

IF YOU WOULD LIKE TO BE ADDED PLEASE EMAIL !
<center>
<b>
<marquee behavior="alternate"scrollamount="5"></font face></font color></font size>
<font color="Green"><font face="Rockwell Extra Bold" size="5">~*HAIR AND MAKEUP!*~</font face></font color></font size></marquee>
</marquee></font face></font color></font size>



<center></a><a><BR>Yolonda Buuck </a><BR><font face="Moderne" size="4">
<font color=BLACK> 225-686-1721<BR> <BR> </font> </font> </font> <BR></A><BR>

<center></a><a href="mailto:Mistypage@megagate.com "><BR>Misty Paige</a><BR><font face="Moderne" size="4">
<font color=BLACK> 601-517-0583<BR> <BR> </font> </font> </font> <BR></A><BR>

<center></a><a href="mailto:Crowncrazy@eatel.net"><BR>Amy Meche </a><BR><font face="Moderne" size="4">
<font color=BLACK> 225-698-6981<BR> <BR> </font> </font> </font> <BR></A><BR>

<center></a><a href="mailto:Farren@dunnroberts.com"><BR>Farren Moss</a><BR><font face="Moderne" size="4">
<font color=BLACK>337-526-0303<BR> <BR> </font> </font> </font> <BR></A><BR>


<center></a><a href="mailto:msticky01@yahoo.com"><BR>Margaret Knott</a><BR><font face="Moderne" size="4">
<font color=BLACK>337-754-7872<BR> <BR> </font> </font> </font> <BR></A><BR>


<center></a><a><BR>Christie Robinson</a><BR><font face="Moderne" size="4">
<font color=BLACK>337-584-2252<BR> <BR> </font> </font> </font> <BR></A><BR>


<center></a><a href="mailto:Wholesaleboiler@aol.com"><BR>Cathy Mulino </a><BR><font face="Moderne" size="4">
<font color=BLACK>225-806-4261<BR> <BR> </font> </font> </font> <BR></A><BR>



<center></a><a href="mailto:Nails1504@aol.com "><BR>Stacy Louque </a><BR><font face="Moderne" size="4">
<font color=BLACK>985-386-0676<BR> <BR> </font> </font> </font> <BR></A><BR>


<center></a><a href="mailto:Crosbycollection@yahoo.com"><BR>Abby Crosby </a><BR><font face="Moderne" size="4">
<font color=BLACK>225-698-6988<BR> <BR> </font> </font> </font> <BR></A><BR>


<center></a><a href="mailto:hjashley812@yahoo.com"><BR>Heather Ashley </a><BR><font face="Moderne" size="4">
<font color=BLACK>601-845-5224<BR> <BR> </font> </font> </font> <BR></A><BR>


<center></a><a href="mailto:daydreams4you@aol.com"><BR>DayDreams Pageant Hair</a><BR><font face="Moderne" size="4">







<font color="hotpink"><font face="Moderne" size="6"></font face></font color></font size>
</center>
</BODY>
</HTML>

jscheuer1
08-17-2005, 06:31 AM
The code works fine here. I get the feeling that your page is being altered by the server. Are you using Yahoo's Geocities by chance? If so, this should be helpful:

Geocities (as are many free hosts) is a poor hosting choice when you are planning on using much javascript. Free hosts generally, Geocities in particular, put many of their own scripts on your page automatically when you upload them. These scripts often conflict with some or all of your own scripts on your page rendering them nonfunctional or dysfunctional. The real test is, if it works locally but, not on Geocities, it could well be script conflicts, there are other possibilities. Two of the biggest conflicts arise when your script uses i or j as variables (Geocities hi-jacks those for its own scripts) or if your scripts attempt to put offsite material inside a frame or iframe on Geocities (they've got scripts designed to prevent that). In the first case you can change all i's used as variables to other more complex variable names, same with j's but, of course, use a different name for all the j's used as variables. The second problem has no work around that I know of.