The JavaScript instructions are shown below in bold.

<HTML>
<HEAD>
<TITLE>JavaScript Demo Example 6</TITLE>
<script language="javascript" type="text/javascript">
<!-- Hide script from older browsers

var stars = new Array("starblue.gif", "stargold.gif", "stargren.gif", "starpurp.gif",
"starslvr.gif", "staryell.gif");

var starcntr = 0;
function starcycle() {
starcntr = starcntr + 1;
if (starcntr == 6) starcntr = 0;
document.star7.src = stars[starcntr];
setTimeout("starcycle()",1000);
}
//-->
</script>

</HEAD>
<BODY BGCOLOR="WHITE" onload="starcycle()">

<table>
<tr>
<td> <h3>Cycle through a series of images using an array and a time delay.
<a href="example_6_html.htm">View source.</a></h3> </td>
<td>
<img src="starblnk.gif" name = "star7" border="0">
</td>
</tr>
</table>

<p>&nbsp;</p>
<p><a href="JavaScriptDemo.htm">Return to Having Fun with JavaScript</a>.</p>

</BODY>
</HTML>

 

Return to Example 6.