View Single Post
  #2 (permalink)  
Old March 3rd, 2010, 04:09 PM
Old Pedant Old Pedant is offline
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Code:
function switchImage()
{
     currentImgNumber++;
     if ( currentImgNumber > numberOfImages ) currentImgNumber = 1;
     document.imgAdvert.src = 'AdvertImage' + currentImgNumber + '.jpg';
     setTimeout("switchImage()",3000);   }
     history.go(-2)
 }
Not sure what the history.go(-2) is for, but the rest is simple enough.

EDIT: I 100% agree w/ PeterPeiGuo. Get rid of that history.go line!

Last edited by Old Pedant; March 4th, 2010 at 03:06 PM..
Reply With Quote