Lo slideshow più
facile che ci sia:
<center>
<script
language="JavaScript">
var i = 0;
var path = new
Array();
var names = new
Array();
// LIST OF
IMAGES
path[0] =
"/public/images/commodore-vic-20.jpg";
path[1] =
"/public/images/Commodore64withdisk.jpg";
path[2] =
"/public/images/PhilipsPC.jpg";
path[3] =
"/public/images/toshiba.jpg";
path[4] =
"/public/images/compaq.jpg";
path[5] =
"/public/images/dell.jpg";
path[6] =
"/public/images/acer.jpg";
path[7] =
"/public/images/surface.jpg";
//LIST OF
DESCRIPTIONS
names[0] =
"Commodore Vic 20";
names[1] =
"Commodore 64";
names[2] =
"Philips 80286";
names[3] =
"Toshiba Travelmate";
names[4] =
"Compaq";
names[5] =
"Dell";
names[6] =
"Acer Travelmate 6292";
names[7] =
"Surface Pro 2";
function
nextImage()
{
if(i < path.length - 1) i++;
else i = 0;
document.slide.src = path[i];
document.getElementById("slideDescr").innerHTML =names[i];
}
function
prevImage()
{
if(i > 0) i--;
else i = path.length-1;
document.slide.src = path[i];
document.getElementById("slideDescr").innerHTML =names[i];
}
</script>
<table
style="width:400px;background-color:black;">
<tbody>
<tr>
<td>
<img src="/public/images/prev.png"
onclick="prevImage()" height="40" width="40">
</td>
<td align="center">
<img name="slide"
src="/public/images/commodore-vic-20.jpg" height="200">
</td>
<td align="right">
<img src="/public/images/next.png"
onclick="nextImage()" height="40" width="40">
</td>
</tr>
<tr>
<td colspan="3" align="center">
<span name="slideDescr"
id="slideDescr">Commodore Vic 20</span>
</td>
</tr>
</tbody>
</table>
</center>
Si ottiene un
risultato di questo tipo