Hello,
I have a nice working javascript for 2 slideshows on one page.
Now I would like to add links to the differente images, but unfortunatelly I don´t know how to do this. Could anyone help me please? Thanks in Advance!!!
Code in the Head
<script type=“text/javascript”>
function swapImage(id, path)
{
var el = document.getElementById(id);
el.count = el.count || 0;
el.src = path[el.count];
el.count = (el.count + 1) % path.length;
}
function slideshow() {
setInterval(function () {
swapImage(‘slide1’, [
“website_images/hoofdcat_2.jpg”,
“website_images/hoofdcat_1.jpg”,
“website_images/hoofdcat_2.jpg”,
“website_images/hoofdcat_1.jpg”,
“website_images/hoofdcat_2.jpg”
]);
swapImage(‘slide2’, [
“website_images/hoofdcat_1.jpg”,
“website_images/hoofdcat_2.jpg”,
“website_images/hoofdcat_1.jpg”,
“website_images/hoofdcat_2.jpg”
]);
}, 3000);
}
onload = slideshow;
</script>
Code in the Body:
<TABLE>
<TD WIDTH=“314” HEIGHT=“445”>
<img id=“slide1” height=“445” width=“315” src=“website_images/hoofdcat_1.jpg”>
</TD>
<TD WIDTH=“314” HEIGHT=“445”>
<img id=“slide2” height=“445” width=“315” src=“website_images/hoofdcat_2.jpg”>
</TD>
</TR>
</TABLE>