I tried to keep as much of the original code as possible, but it got a little complicated. Anyway - it's the same concept, just rotating divs instead of images...
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
</head>
<body>
<style>
.hide{
display:none;
}
</style>
<div id="banner"></div>
<div class="hide" id="div0"><img src="photo_JBG_0315.JPG"><div class="slideTitle"> CAPTION ONE TEXT</div></div>
<div class="hide" id="div1"><img src="photo_JBG_3341.JPG"><div class="slideTitle"> CAPTION TWO TEXT</div></div>
<div class="hide" id="div2"><img src="photo_JBG_3506.JPG"><div class="slideTitle"> CAPTION THREE TEXT</div></div>
<script type="text/javascript">
var newBanner = 0;
var shown;
function cycleBan() {
if (shown) {
document.getElementById("div"+shown).style.display="none";
} else {
document.getElementById("div0").style.display="none";
}
newBanner++;
if (newBanner == 3) {
newBanner = 0;
}
document.getElementById("div"+newBanner).style.display="block";
shown=newBanner;
// set the time below for length of image display
// i.e., "4*1000" is 4 seconds
setTimeout("cycleBan()", 2*1000);
}
window.onload=cycleBan;
</script>
</body>
</html>
Bookmarks