View Single Post
  #1 (permalink)  
Old March 2nd, 2010, 02:55 PM
JohnAlex1101 JohnAlex1101 is offline
Registered User
Join Date: Mar 2010
Location: Tampa, FL
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default How to recycle an image?

In their fine book, Beginning JavaScript v4, in Chapter 10, the authors show how to go through three images. How do I close this and recycle to the beginning?
<script language=JavaScript type="text/javascript">
var currentImgNumber = 1;
var numberOfImages = 3;

function window_onload()
function switchImage()
	document.imgAdvert.src = 'AdvertImage' + currentImgNumber + '.jpg';
		setTimeout("switchImage()",3000);   }


<body onload="window_onload()">
<img src="AdvertImage1.jpg" name="imgAdvert" />

Reply With Quote
The Following User Says Thank You to JohnAlex1101 For This Useful Post: