Html problem, Please help?

Ryan M

New member
Im doing a site and im an a more advanced html, .php ect. but i can not get this to work right. im doing my site and since its xmas still i want to just make sure it works right and i added (Javascript) snowflakes. I tried this on just a tiny html to test it and it worked fine. After i put code in my real website and load it it shows the snowflake in the corner and it just stayer there. Theres nothing else, Here is my code for it.
"
<html>
<head>
<title>snow</title>
<script src="snowflake.js"></script>
</head>
<style>
body{
background:black;
}
</style>
<body>
"
That is the simple html i tried and it worked. I put the code <script src="snowflake.js"></script> in on my main one and those were my results. Here is my Snowflake js code
"
var snowmax=35
var snowcolor=new Array("#aaaacc","#ddddFF","#ccccDD")
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")
var snowletter="*"
var sinkspeed=0.4
var snowmaxsize=40
var snowminsize=8
var snowingzone=1
var mouse=1
var snow=new Array()
var marginbottom
var marginright
var timer
var i_snow=1
var x_mv=new Array();
var crds=new Array();
var lftrght=new Array();
var browserinfos=navigator.userAgent
var ie5=document.all&&document.getElementByI…
var ns6=document.getElementById&&!document.a…
var opera=browserinfos.match(/Opera/)
var browserok=ie5||ns6||opera

function randommaker(range) {
rand=Math.floor(range*Math.random())
return rand
}

function initsnow() {
if (ie5 || opera) {
marginbottom = document.body.clientHeight
marginright = document.body.clientWidth
}
else if (ns6) {
marginbottom = window.innerHeight
marginright = window.innerWidth
}
var snowsizerange=snowmaxsize-snowminsize
for (i=0;i<=snowmax;i++) {
crds = 0;
lftrght = Math.random()*15;
x_mv = 0.03 + Math.random()/10;
snow=document.getElementById("s"+i)
snow.style.fontFamily=snowtype[random…
snow.size=randommaker(snowsizerange)+…
snow.style.fontSize=snow.size
snow.style.color=snowcolor[randommake…
snow.sink=sinkspeed*snow.size/5
if (snowingzone==1) {snow.posx=randommaker(marginright-sn…
if (snowingzone==2) {snow.posx=randommaker(marginright/2-…
if (snowingzone==3) {snow.posx=randommaker(marginright/2-…
if (snowingzone==4) {snow.posx=randommaker(marginright/2-…
snow.posy=randommaker(2*marginbottom-…
snow.style.left=snow.posx
snow.style.top=snow.posy
}
movesnow()
}

function movesnow() {
for (i=0;i<=snowmax;i++) {
crds += x_mv;
snow.posy+=snow.sink
snow.style.left=snow.posx+lftrght[…
snow.style.top=snow.posy

if (snow.posy>=marginbottom-2*snow.si… || parseInt(snow.style.left)>(marginrigh…
if (snowingzone==1) {snow.posx=randommaker(marginright-sn…
if (snowingzone==2) {snow.posx=randommaker(marginright/2-…
if (snowingzone==3) {snow.posx=randommaker(marginright/2-…
if (snowingzone==4) {snow.posx=randommaker(marginright/2-…
snow.posy=0
}
}
var timer=setTimeout("movesnow()",50)
}

for (i=0;i<=snowmax;i++) {
document.write("<span id='s"+i+"' style='position:absolute;top:-"+snowmaxs…
}
if (browserok) {
window.onload=initsnow
}

"
Please help :)
 
Back
Top