0

I need help, HTML--i have two links, linkA & linkB--when clicking linkA -should display image1 and whn clicking linkB image2 should be displayed.
The trick is they must be displayed in one image tag.
any one who can help with that?
I would appreciate your help.

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by almostbob
0
<img id='bigimage' src='image3.jpg' width=x height=y>
<a onclick="document.getElementById('bigimage').src='image1.jpg';">Image1</a>
<a onclick="document.getElementById('bigimage').src='image2.jpg';">Image2</a>

Edited by almostbob: n/a

0

Left stuff out of that code above
clicking as it is will take whatever time to download the images before the image changes, when the link is first clicked

<html><head></head><body><!--bla bla bla -->
<img id='bigimage' src='image3.jpg' width=x height=y>
<a onclick="document.getElementById('bigimage').src='image1.jpg';">Image1</a>
<a onclick="document.getElementById('bigimage').src='image2.jpg';">Image2</a>
<!-- bla bla bla -->
</body>
<script type="text/javascript">
//<![CDATA[
<!-- 
image1 = new Image();
image1.src = "image1.jpg";
image2 = new Image();
image2.src = "image2.jpg";
//-->
//]]>
</script>
</html>

loads the images into the tif, after the page is fully displayed (preloading in the head is a bad idea delays page loading) so that when the link is clicked the image displays immediately
any number of images can be loaded into the tif
I think this is better

Edited by almostbob: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.