I am trying to create a simple script to make 3 banners cyle for 5 seconds. I've tried figuring out what is wrong with my code but all it does is show the first banner and then skip the second banner to go to the third banner.
Here's the script that I wrote: Hopefully you can help me and pinpoint my mistake.
Thanks in advance for your help!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Concert Ads </title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript">
//<![CDATA[
function changeConcertAd( ) {
var curImage = "concert1"
if (curImage == "concert3") {
document.images[0].src = "concert1.gif";
curConcertAd = "concert1";
document.images[0].src = "concert2.gif";
curConcertAd = "concert2";
}
else {
document.images[0].src = "concert3.gif";
curConcertAd = "concert3";
}
}
//]]>
</script>
</head>
<body onload="var begin=setInterval('changeConcertAd( )',5000);">
<p><img src="concert1.gif" name="concert1" id="concert1" alt="Advertising image for a concert series" /></p>
</body>
</html>