Hi. I’m trying to add captions to an already working SlideShow, but I cannot get it to work. If I add – if (document.getElementById) document.getElementById(“CaptionBox”).innerHTML= Caption[jss]; – the SlideShow doesn’t rotate anymore. The CaptionBox shows up, but there’s no movement. Here’s the code:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<html>
<head>
<title>Welcome to My Page</title>
<style type=”text/css”>
.Caption {color: #660066;
font-family: arial;
font-size: 14px;
font-weight: bold;}
</style>
<script>
var SlideShowSpeed = 5000;
var CrossFadeDuration = 2;
var Picture = new Array();
var Caption = new Array();
Picture[1] = ‘image1.jpg’;
Picture[2] = ‘image1.jpg’;
Picture[3] = ‘image1.jpg’;
Picture[4] = ‘image1.jpg’;
Picture[5] = ‘image1.jpg’;
Caption[1] = “Caption1”;
Caption[2] = “Caption1”;
Caption[3] = “Caption1”;
Caption[4] = “Caption1”;
Caption[5] = “Caption1”;
var tss;
var iss;
var jss = 1;
var pss = Picture.length-1;
var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}
function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter=”blendTrans(duration=2)”;
document.images.SlideShow.style.filter=”blendTrans(duration=CrossFadeDuration)”;
document.images.SlideShow.filters.blendTrans.Apply();}
document.images.SlideShow.src = preLoad[jss].src;
if (document.getElementById) document.getElementById(“CaptionBox”).innerHTML= Caption[jss];
if (document.all) document.images.SlideShow.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout(‘runSlideShow()’, SlideShowSpeed);
}
</script>
</head>
<body onload=”runSlideShow()”>
<div align=”center”>
<table border=0 cellpadding=0 cellspacing=0>
<tr><div align=”center”><img src=/year3/images/java3easter08/easter08_1.jpg name=’SlideShow’ width=533 height=400></td></tr>
<tr><td id=CaptionBox class=Caption align=center>Let The Hunt Begin!</td></tr>
</div>
</table>
</body>
</html>
I’m really lost here and I’ve been staring at this stupid code for about 4 hours now and I cannot figure out what’s wrong. It’s probably something stupid like syntax or I forgot some text. Can anyone help me out?
Thanks.