Mega Code Archive

 
Categories / JavaScript DHTML / HTML
 

Simple Image Replacement

<html> <head> <title>Replacing Images</title> <script language="JavaScript"> var ix = 0 function changeImages(milliseconds) {    window.setInterval("changeImage()", milliseconds) } function changeImage() {      ++ix;      ix %= 6;      var imageRef = document.images[0];      imageRef.src = "http://www.rntsoft.com/style/"+ix+".gif"; } </script> </head> <body onload="changeImages(500)"> <p align="center"><img id="changeme" src="http://www.rntsoft.com/style/1.gif"></p> </body> </html>