Hello,
I am trying to set up a Javascript diaporama. It did work, but I've done something that has broken my code, and I can't find what !!
Here's my code :
Internet explorer says : on Line 1 char 1 : object expected ...
I anyone has a clue, I would be grateful
Thanks,
Floof
I am trying to set up a Javascript diaporama. It did work, but I've done something that has broken my code, and I can't find what !!
Here's my code :
Code:
<html>
<!---------------------------------------------------------------->
<!-- HTML Header -->
<!---------------------------------------------------------------->
<head>
<title>Diaporama</title>
<link rel="stylesheet" type="text/css" href="/Templates/hp.css">
</head>
<script language="javascript">
<!-- //
var ImgLoaded = "false";
var ImgCount = 25;
var ImgShown = 0;
var ImgPrefix = "gifs/hot_cdg_";
var ImgSufix = ".jpg";
var ImgArray = new Array(ImgCount);
var TidDiaporama = 0;
var DiaporamaPaused = "true";
function LoadImages ()
{var i = 1;
while (i <= ImgCount)
{if ((i == 2)||(i == 16))
{ImgArray[i] = new Image (240,360);
}
else
{ImgArray[i] = new Image (360,240);
}
ImgArray[i].src = ImgPrefix + i + ImgSufix;
i++;
}
ImgPlay = new Image (32,32);
ImgPlay.src = "gifs/btn_play.jpg";
ImgPause = new Image (32,32);
ImgPause.src = "gifs/btn_pause.jpg";
ImgPrev = new Image (32,32);
ImgPrev.src = "gifs/btn_prev.jpg";
ImgNext = new Image (32,32);
ImgNext.src = "gifs/btn_next.jpg";
ImgLoaded = "true";
}
function ShowNext ()
{if (ImgShown < ImgCount)
{TagImgShown.src = ImgArray[img]hown + 1[/img].src;
ImgShown ++;
}
else
{TagImgShown.src = ImgArray[1].src;
ImgShown = 1;
}
}
function ShowPrev()
{if (ImgShown > 1)
{TagImgShown.src = ImgArray[img]hown - 1[/img].src;
ImgShown --;
}
else
{TagImgShown.src = ImgArray[img]ount[/img].src;
ImgShown = ImgCount;
}
}
function StopDiaporama()
{clearInterval(TidDiaporama);
DiaporamaPaused = "true";
TagImgPlay.src = ImgPlay.src;
}
function StartDiaporama()
{TidDiaporama = setInterval("ShowNext()",5000);
DiaporamaPaused = "false";
TagImgPlay.src = ImgPause.src;
}
funtion BTNPlayCallback ()
{if (DiaporamaPaused == "true") StartDiaporama();
if (DiaporamaPaused == "false") StopDiaporama();
}
LoadImages();
// -->
</script>
<!---------------------------------------------------------------->
<!-- HTML Body -->
<!---------------------------------------------------------------->
<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<!---------------------------------------------------------------->
<!-- Beginning Of Document Table-->
<!---------------------------------------------------------------->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="1" valign="top">
<!---------------------------------------------------------------->
<!-- Separation Column -->
<!---------------------------------------------------------------->
<td valign="top" width="15"><img src="/gifs/spacer.gif" width="15"></td>
<!---------------------------------------------------------------->
<!-- Beginning of central section -->
<!---------------------------------------------------------------->
<td valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<!---------------------------------------------------------------->
<!-- Separation row -->
<!---------------------------------------------------------------->
<tr>
<td width="100%" height="15"></td>
</tr>
<!---------------------------------------------------------------->
<!-- Module : "Photos" -->
<!---------------------------------------------------------------->
<tr>
<td width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- Module Title -->
<tr>
<td width="10" height="20" valign="top" class="ModuleCell"><img src="/gifs/corner_top_left_trans.gif" width="10" height="20"></td>
<td height="20" class="ModuleCell">
<span class="newsheader">Hot Spot at the Charles de Gaule Airport - Diaporama</span>
</td>
<td width="10" height="20" align="right" valign="top" class="ModuleCell"><img src="/gifs/corner_top_right_trans.gif" width="10" height="20"></td>
</tr>
<!-- Module Separation Row -->
<tr>
<td width="10" height="15" class="regular"></td>
<td height="15" class="regular"></td>
<td width="10" height="15" class="regular"></td>
</tr>
<!-- Module Body -->
<tr>
<td class="regular" width="10"></td>
<td align="center" valign="middle" class="regular">
<img id="TagImgShown" src="gifs/loading.jpg">
</td>
<td class="regular" width="10"></td>
</tr>
<!-- Module Separation Row -->
<tr>
<td width="10" height="15" class="regular"></td>
<td height="15" class="regular"></td>
<td width="10" height="15" class="regular"></td>
</tr>
<!-- Module Body -->
<tr>
<td class="regular" width="10"></td>
<td align="center" valign="middle" class="regular">
<table border="0" cellspacing="10" cellpadding="0">
<tr>
<td><a href="javascript:alert(ShowPrev);"><img id="TagImgPrev" src="gifs/btn_prev.jpg" border="0"></a></td>
<td><a href="javascript:BTNPlayCallback();"><img id="TagImgPlay" src="gifs/btn_play.jpg" border="0"></a></td>
<td><a href="javascript:ShowNext();"><img id="TagImgNext" src="gifs/btn_next.jpg" border="0"></a></td>
</tr>
</table>
</td>
<td class="regular" width="10"></td>
</tr>
<!-- Module Footer -->
<tr>
<td width="10" valign="bottom" class="regular"><img src="/gifs/corner_btm_left_trans.gif" width="10" height="10"></td>
<td class="regular"></td>
<td width="10" align="right" valign="bottom" class="regular"><img src="/gifs/corner_btm_right_trans.gif" width="10" height="10"></td>
</tr>
</table>
</td>
</tr>
<!---------------------------------------------------------------->
<!-- Central Section End -->
<!---------------------------------------------------------------->
</table>
</td>
<!---------------------------------------------------------------->
<!-- Right Margin -->
<!---------------------------------------------------------------->
<td width="15"><img src="/gifs/spacer.gif" width="15"></td>
<!---------------------------------------------------------------->
<!-- Main Table End -->
<!---------------------------------------------------------------->
</tr>
</table>
<!---------------------------------------------------------------->
<!-- HTML Footer -->
<!---------------------------------------------------------------->
</body>
</html>
Internet explorer says : on Line 1 char 1 : object expected ...
I anyone has a clue, I would be grateful
Thanks,
Floof