This is the code to store five images for an HTML page and then the function is used to display those five images one at a time.
This code works and one can scroll through the five images.
My question is whether it is possible to direct to different HTML page on the basis of image shown at a particular time
<script type="text/javascript">
var curImage = 0;
var cImages = ['1.jpg','2.jpg','3.jpg','4.jpg','5.jpg'];
function townHousePics(direction) {
if (direction == 'next') {
curImage++;
if (curImage == 5) {
curImage = 0;
}
}
else
{
curImage--;
// even reset the counter here when
// its getting 0
}
document.images[0].src = cImages[curImage];
}
</script>
imageinanchortag withhrefof the html page where you want to redirect!... and your work is done.