PDA

View Full Version : vajascript slideshow + image map



Mafetapaz
10-01-2010, 10:14 AM
I've got a Javascript presentation with 100 images, i need an image map on the image 95. How can I add it?

that's the code

JAVASCRIPT

<script type="text/javascript" language="javascript">
var images = new Array (100);
images[0] = "01_generale_.html_files/01_generale_.001.jpg";
images[1] = "01_generale_.html_files/01_generale_.002.jpg";
images[2] = "01_generale_.html_files/01_generale_.003.jpg";
...
images[99] = "01_generale_.html_files/01_generale_.004.jpg";

var index = 0;
function WindowLoaded(evt)
{
document.body.onselectstart = function () { return false; };
}
function Step(i)
{
GoTo(index + i)
}
function GoTo(newIndex)
{
if(newIndex >= 0 && newIndex < images.length)
{
index = newIndex;
document.Slideshow.src = images[index];
}
}
</script>

and that's the html Body


<body bgcolor="white" onload='WindowLoaded(event);'>
<p align="center">
<br/>
<br/>
<img name="Slideshow" alt="" src="01_generale_.html_files/01_generale_.001.jpg"/>
<br/>
<br/>
<input type="image" src="01_generale_.html_files/home.png" onclick="GoTo(0)"/>
&nbsp;&nbsp;&nbsp;
<input type="image" src="01_generale_.html_files/prev.png" onclick="Step(-1)"/>
<input type="image" src="01_generale_.html_files/next.png" onclick="Step(1)"/>
</p>

</body>