Hi everyone,
I would like to add hyperlinks to the text appearing or another when
working with the onClick event. Unfortunately this version is pulling
the text from the (title) attribute withing the <atag. Is there a
way to display linkable text in addition to the text and image that are
showing.
Does anyone know how to make this work with the script or another
method of tagging? Please help!
Here is a link to what I'm talking about.
http://www.freshoffshoots.com/gallery_exp/swapper.html
-------------The code--------------------------------
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('placeholder').src = whichpic.href;
if (whichpic.title) {
document.getElementById('desc').childNodes[0].nodeValue =
whichpic.title;
} else {
document.getElementById('desc').childNodes[0].nodeValue =
whichpic.childNodes[0].nodeValue;
}
return false;
} else {
return true;
}
}
</script>
<!--These are the links -->
<div>
<ul>
<li><a onclick="return showPic(this)" href="fullsize/B&H35cam.jpg"
title="B&H 35cam" <img src="thumb/B&H35cam_thumb.jpg" width="45"
height="42" border="0"></a></li>
<li><a onclick="return showPic(this)" href="fullsize/cinelin.jpg"
title="Cinema scene" ><img src="thumb/cinelin_thumb.jpg" width="45"
height="46" border="0"></a></li>
<li><a onclick="return showPic(this)" href="fullsize/devrycam.jpg"
title="devrycam is one good camera"><img src="thumb/devrycam.jpg"
width="45" height="31" border="0"></a></li>
</ul>
<!-- this is the description -->
<div id="display">
<div id="summary">
<p id="desc">Start with default text or the text of the image
showing</a></p>
</div>
<!-- this is the image -->
<div id="picbox">
<img id="placeholder" src="fullsize/B&H35cam.jpg" alt="Isn't it lovely"
/>
</div>
</div><!--end summary-->
</div><!--end display-->
</body>
</html>