Sorry, I'm a total beginner and maybe pushing my luck!
I've got a sequence of images that can be clicked through, the final image linking to a new page. This works well in all browsers but Opera where, on clicking that final image, 'Image' flashes on screen before loading the new page - and clicking back from the new page displays just this undefined 'Image'. Is there something wrong with the code?
Also, is there a neater way of displaying and maintaining the pointer when over the image?
Thanks for reading!
Code:
<script type="text/javascript" language="javascript">
pics = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg"];
var index = 1;
function showNextPic() {
document.getElementById('imagePlaceholderA').src = pics[index];
if (index == pics.length) {document.getElementById('link').href = "index.html"; }
index++;
}
</script>
<style type="text/css">
.styleCursorHand {
cursor: pointer;
}
.styleCursorNormal {
cursor: auto;
}
</style>
</head>
<body>
<table>
<tr>
<td>
<a id="link"><img src="1.jpg" id="imagePlaceholderA" onClick="showNextPic()" onMouseOver="this.className='styleCursorHand';" onClick="this.className='styleCursorHand';" onMouseDown="this.className='styleCursorHand';" onMouseOut="this.className='styleCursorNormal';"></a>
</td>
</tr>
</table>
</body>
|