In article <40******@dnews.tpgi.com.au>,
ph****@hotmail.com enlightened
us with...
kaeli wrote: In article <40******@dnews.tpgi.com.au>, ph****@hotmail.com enlightened
us with...
Hi
I am trying to create an interactive links. I am not sure if I should
use table or Layer (DIV) to display picture or text within either a
table cell or a Layer.
If I click on link A, it would display an image or text in a window.
Click on link B and a new image is displayed, replacing the previous
image/text. All this is done without loading a new page.
You need to support older browsers, or just the more recent ones like
IE5+, netscape 6+, and Opera 6+?
If supporting NN4, you'll need a special layer tag, otherwise, just use
whatever you want, because you can change the src attribute of an image
with JS.
I am not very good with JavaScript. How would you do it?
How would *I* do it?
Tested in IE6, NN7, and Opera 7. Won't work in NN4. Dunno about Safari,
or IE Mac or other browsers, but it shouldn't kill anything.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title> test image switch </title>
<script type="text/javascript">
var imgArray = new Array("tri.gif","tridown.gif","trileft.gif");
function switchIt(num)
{
if (document.images)
{
document.images["img_1"].src=imgArray[num];
}
}
</script>
</head>
<body>
<p>Click on the links to see the pics.</p>
<p>
<a href="#" onClick="switchIt(0);return false;">default (0)</a><br>
<a href="#" onClick="switchIt(1);return false;">one</a><br>
<a href="#" onClick="switchIt(2);return false;">two</a><br>
</p>
<div>
Image will appear here.<br>
<img src="tri.gif" id="img_1" name="img_1">
</div>
</body>
</html>
Note: if you want to do text instead of images, it's quite a bit
different.
--
--
~kaeli~
Experience is something you don't get until just after you
need it.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace