Im helping out a friend and making a gallery for them with JavaScript, it works fine in every browser - except surprise surprise IE 6
http://www.bobvideo.co.uk/os/gmj/earth.html
That is a link to the gallery, Im currently viewing in Opera 9 and its working perfectly. This is the script:
<script type="text/javascript" language="javascript">
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>
The placeholder code is:
<p id="desc"> </p>
<img src="images/gallery/earth/earth1.jpg" alt="" id="placeholder"/>
The code for a single thumbnail is:
<ul>
<li><a onclick="return showPic(this)" href="images/gallery/earth/earth1.jpg" title="Earth 1">
<img class="thumb" src="images/gallery/earth/earth1_p.jpg"></a></li>
</ul>
When you click on a thumbnail in IE the larger image opens in a new window, why is this happening?