Here is a little script

Here is a little script to cycle a rotater once.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
https://www.w3.org/TR/html4/loose.dtd”&gt;
<html>
<head>
<meta https-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<title>Untitled Document</title>


var banArray = new Array(3); //for banners, increase size as necessary
var counter = 1;
var duration = 1000;
var url = “https://javascript.internet.com&#8221;; //initial URL

if(document.images) //pre-load all banner images
{
banArray[0] = new Image(468, 60);
banArray[0].src = “C:/Documents and Settings/md00037/Desktop/1.jpg”;
banArray[1] = new Image(468, 60);
banArray[1].src = “C:/Documents and Settings/md00037/Desktop/2.jpg”;
banArray[2] = new Image(468, 60);
banArray[2].src = “C:/Documents and Settings/md00037/Desktop/3.jpg”;
}

function changeBanner() //banner changer function
{
if(counter > 2)
{
changeDuration();
counter = 0;
}

document.banner.src = banArray[counter].src; //sets a new banner
counter++; //increase the counter for the next banner
}

//calls the changeBanner() function every 3 seconds
//change the timer as necessary (minutes * 60000) or (seconds * 1000)
function changeDuration()
{
window.clearInterval(timer);
return;
}
var timer = window.setInterval(“changeBanner()”, duration);

//–>
</head>

<body>
<img src=”C:/Documents and Settings/md00037/Desktop/1.jpg” width=468 height=60 border=0 name=”banner”></a>
</body>
</html>

Leave a comment