Expand|Select|Wrap|Line Numbers
- <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