PDA

View Full Version : where i am wrong?


alaios
12-09-2002, 08:06 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<style type="text/css">
.theimage {position:absolute; left:200px; top:10px; z-index:2}
</style>
<script language="Javascript">
function move(x)
{
if (document.layers)
{
document.snow.left=x;
x+=5;
setTimeout('move('+x+')',100);
}
if (document.all)
{
document.all.snow.style.left=x;
x+=5;
setTimeout('move()',100);
}
}
move(100);
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<div name="snow" id="snow" class="theimage">
<img src="snow.gif">
</div>
</body>
</html>

boggly
12-09-2002, 08:20 PM
I just gave it a quick glance, but noticed that you have one if conditional right after another. You should use an else if conditional after the if conditional.

boggly

alaios
12-10-2002, 08:17 AM
snif!snif

cheesebagpipe
12-10-2002, 08:27 AM
Remove:

move(100);

Replace with:

<body onload="move(100)">

glenngv
12-10-2002, 08:31 AM
...and you did not supply the parameter in the move() function in the document.all block

if (document.all)
{
document.all.snow.style.left=x;
x+=5;
setTimeout('move()',100);
}

you should have done it like you did in the document.layer block:

setTimeout('move('+x+')',100);

alaios
12-10-2002, 09:12 AM
plz guys help me

glenngv
12-10-2002, 09:37 AM
didn't the above posts help?

piglet
12-10-2002, 12:49 PM
Hi alaios,

Were you planning on doing anything once the image reached the right side of the page? At the moment (wih the changes already suggested) the image will keep going off to the right forever!

Roy Sinclair
12-10-2002, 04:32 PM
Where are you wrong? You are wrong in not describing the problem you want fixed. We aren't mind readers and I'm suprised at how much assistance you got already. You need to do better than ask generic questions and then whimper (sorry but your follow up replies simply don't add anything to clue us in) when you don't get the answer you're expecting.

Great help is available here but you really have to start with a good description of the problem.