A
Ade
Hi,
I'm new to all this stuff so please go easy on me if this is a simple error
This code is to swap two images on a page by use of a timer. It works in IE
but not in Firefox. Can someone please point out what's wrong?
Thanks,
Ade
<html>
<head>
<script language="javascript" type="text/javascript">
var Timer; // = setTimeout("swap()",1000);
var iPic;
var aPics=new Array();
iPic=0;
aPics[0]="img1.bmp";
aPics[1]="img2.bmp";
function swap()
{ if (iPic == 1)
iPic=0;
else
iPic=1;
document.all.myImage.src = aPics[iPic];
Timer = setTimeout("swap()",1000);
}
</script>
</head>
<body onload=swap();>
<img name="myImage" src="img1.bmp"></img>
</body>
</html>
I'm new to all this stuff so please go easy on me if this is a simple error
This code is to swap two images on a page by use of a timer. It works in IE
but not in Firefox. Can someone please point out what's wrong?
Thanks,
Ade
<html>
<head>
<script language="javascript" type="text/javascript">
var Timer; // = setTimeout("swap()",1000);
var iPic;
var aPics=new Array();
iPic=0;
aPics[0]="img1.bmp";
aPics[1]="img2.bmp";
function swap()
{ if (iPic == 1)
iPic=0;
else
iPic=1;
document.all.myImage.src = aPics[iPic];
Timer = setTimeout("swap()",1000);
}
</script>
</head>
<body onload=swap();>
<img name="myImage" src="img1.bmp"></img>
</body>
</html>