why won't this code work??

G

Guest

Please can someoine tell me why this piece of code won't work. I am using
Frontpage 2003. Thanks in advance

<html>
<head><title>Shared Top Border</title>
<script language="javascript">
<!--
var infonum = 1;

function rotateinfo() {
if (++infonum > 3)
infonum = 1;
infoX.src = "info" + infonum + ".jpg";
window.setTimeout('rotateinfo();', 3000);
}
//-->
</script>
</head>

<body style="none" onLoad="window.setTimeout=('rotateinfo();', 3000);">
<p align="center">
<img id="infoX" border="0" src="info1.jpg" width="474" height="100"
style="border-style: solid; border-width: 1px; padding-left: 4px;
padding-right: 4px; padding-top: 1px; padding-bottom: 1px"></p>
<p> </p>

</body>
</html>
 
J

Jon Spivey

Hi,
You need to address the image with getelementbyid -
document.getElementById(infoX).src = "info" + infonum + ".jpg";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top