Hi, I making an image gallery with thumbails and previous and next buttons. I search the forum and found [URL=”http://www.webdeveloper.com/forum/showthread.php?t=20940&highlight=image+gallery+thumbnails”]this thread [B]Mr J
I tweaked it a little for my site and this is what I got:
[CODE]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<SCRIPT language=JavaScript>
<!–
maxPic = 3;
mypic = new Array();
mypic[0]=”imagenes/uk/alan_peters.jpg”;
mypic[1]=”imagenes/uk/alison_crowther.jpg”;
mypic[2]=”imagenes/uk/andrew_skelton.jpg”;
function showpic(n){
document.getElementById(“mainpic”).src=mypic[n]
count=n
}
count = 0;
function next() {
count++;
if (count > maxPic-1) {
count = 0;
}
document.getElementById(“mainpic”).src=mypic[count]
}
function prev() {
count–;
if (count == -1) {
count = maxPic-1;
}
document.getElementById(“mainpic”).src=mypic[count]
}
// –>
</SCRIPT>
</head>
<body>
<table border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tr>
<td><img src=”imagenes/uk/alan_peters.jpg” name=”mainpic” width=”490″ height=”350″ id=”mainpic”></td>
<td> </td>
<td><table width=”200″ border=”0″ cellspacing=”5″ cellpadding=”0″>
<tr>
<td><a href=”javascript:showpic(0)”><img src=”imagenes/uk_light/alan_peters.jpg” width=”60″ height=”35″ border=”0″></a></td>
<td><a href=”javascript:showpic(1)”><img src=”imagenes/uk_light/alison_crowther.jpg” width=”60″ height=”35″ border=”0″></a></td>
<td><a href=”javascript:showpic(2)”><img src=”imagenes/uk_light/andrew_skelton.jpg” width=”60″ height=”35″ border=”0″></a></td>
</tr>
<tr>
<td colspan=”3″><div align=”center”><a href=”javascript:prev()”>prev</a> | <a href=”javascript:next()”>next</a> </div></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
It works just fine but I want to have captions for each fullsized picture. Im sure its easy but I just cant get it to work. Any ideas? Any help would be greatly appreciated.
Angela