I've done enough poking around lately to realise that there is a deficiency in Firefox when it comes to using document.images to reference an image for the purpose of building a slideshow. The code below works as I expected in IE, but just sits there in Firefox:
[color=darkred][color=#000000][/color]
[/color]
My question is if anyone knows of another way to accomplish the same effect using javascript? I know there are java classes that you can by/download and there are some CSS tricks that might do the trick, but I'm looking for a javascript solution. Can anyone help? TIA.
John
Code:
<html>
<head>
<script language="JavaScript" type="text/javascript">
<!--
theimages = new Array("images/mathnightpic1.jpg","images/mathnightpic2.jpg","images/mathnightpic3.jpg");
//variable that will increment through the images
var thisimage = 0;
var imagecount = theimages.length;
function rotate()
{
if (document.images)
{
thisimage++;
if (thisimage == imagecount)
{
thisimage = 0;
}
document.images["mainimage"].src = theimages[thisimage];
setTimeout("rotate()", 3 * 1000);
}
}
//-->
</script>
</head>
<body onload="rotate()">
<img src="images/mathnightpic1.jpg" name="mainimage" width=316 height=237>
</body>
</html>
[/color]
My question is if anyone knows of another way to accomplish the same effect using javascript? I know there are java classes that you can by/download and there are some CSS tricks that might do the trick, but I'm looking for a javascript solution. Can anyone help? TIA.
John
Comment