Slideshow kode?
Jeg har fundet en kode på et slide show som jeg så vil lave om i. Slide kører automatisk fr starten og der har være en start og stop knab på siden.Det jeg skal ruge den til er, at man selv skifter fra billede til billede.
Som det ser ud nu kommer siden frem med to fejl i scriptet og dem vil jeg selvfølgelig gerne have væk.
Koden:
<html>
<head>
<title>Main</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="web-style" rel="stylesheet" type="text/css">
</head>
<div align="left"></div>
<table width="570" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="40" colspan="2" valign="middle"><span class="overskrift">Fotos</span></td>
</tr>
<tr>
<td width="569" height="14"></td>
<td width="1"></td>
</tr>
<tr>
<td height="18" colspan="2" valign="top"><span class="normaltext"> - fra loppemarket</span></td>
</tr>
<tr>
<td height="13"></td>
<td></td>
</tr>
<tr>
<td height="245" valign="middle">
<img name="_Ath_Slide" width="348" height="259" align="left" class="ram4" id="_Ath_Slide" onload="OnImgLoad()" >
<p align="center"><br>
<br>
<br>
<br>
<br>
<br>
<br>
<a href="#" id="btnPrev" onClick="Prev();"><< Tilbage</a>
| <a href="#" id="btnNext" value=" Next >> " onClick="Next();">Næste >></a><br>
<script language="JavaScript1.2">
/*
Interactive Image slideshow with text description
By Christian Carlessi Salvadó (cocolinks@c.net.gt). Keep this notice intact.
Visit http://www.dynamicdrive.com for script
*/
g_fPlayMode = 0;
g_iimg = -1;
g_imax = 0;
g_ImageTable = new Array();
function ChangeImage(fFwd)
{
if (fFwd)
{
if (++g_iimg==g_imax)
g_iimg=0;
}
else
{
if (g_iimg==0)
g_iimg=g_imax;
g_iimg--;
}
Update();
}
function getobject(obj){
if (document.getElementById)
return document.getElementById(obj)
else if (document.all)
return document.all[obj]
}
function Update(){
getobject("_Ath_Slide").src = g_ImageTable[g_iimg][0];
getobject("_Ath_FileName").innerHTML = g_ImageTable[g_iimg][1];
getobject("_Ath_Img_X").innerHTML = g_iimg + 1;
getobject("_Ath_Img_N").innerHTML = g_imax;
}
function Play()
{
g_fPlayMode = !g_fPlayMode;
if (g_fPlayMode)
{
getobject("btnPrev").disabled = getobject("btnNext").disabled = false;
Next();
}
else
{
getobject("btnPrev").disabled = getobject("btnNext").disabled = false;
}
}
function OnImgLoad()
{
if (g_fPlayMode)
window.setTimeout(g_dwTimeOutSec*1000);
}
function Tick()
{
if (g_fPlayMode)
Next();
}
function Prev()
{
ChangeImage(false);
}
function Next()
{
ChangeImage(true);
}
////configure below variables/////////////////////////////
//configure the below images and description to your own.
g_ImageTable[g_imax++] = new Array ("foto/pic001.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic002.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic003.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic004.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic005.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic006.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic007.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic008.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic009.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic010.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic011.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic012.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic013.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic014.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic015.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic016.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic017.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic018.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic019.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic020.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic021.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic022.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic023.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic024.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic025.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic026.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic027.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic028.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic029.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic030.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic031.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic032.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic033.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic034.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic035.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic036.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic037.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic038.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic039.jpg");
g_ImageTable[g_imax++] = new Array ("foto/pic040.jpg");
//extend the above list as desired
////End configuration/////////////////////////////
if (document.getElementById||document.all)
window.onload=Play
</script>
</p> </td>
</tr>
<tr>
<p align="right">
</table>
<!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td valign="top">
</tr>
</table>
</body>
</html>
Er der nogen som kan hjælpe mig med det?
Eller som nogen som eventuelt kender en bedre løsning som har samme funktioner som det jeg skal have?
Casper Andersen