topical media & game development

talk show tell print

basic-javascript-09-Adverts.htm / htm



  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
  <html>
  <head>
  <script language=JavaScript type="text/javascript">
  var currentImgNumber = 1;
  var numberOfImages = 3;
  function window_onload()
  {
     setTimeout("switchImage()",3000);
  }
  function switchImage()
  {
     currentImgNumber++;
     document.imgAdvert.src = "AdvertImage" + currentImgNumber + ".jpg";
     if (currentImgNumber < numberOfImages)
     {
        setTimeout("switchImage()",3000);   }
     }
  </script>
  </head>
  <body onload="window_onload()">
  <img src="AdvertImage1.jpg" name="imgAdvert">
  </body>
  </html>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.