O
osmanjaro
Hi all, This should be a simple fix for someone.
I'm making a site that uses only one tiny bit of javascript.
It's for opening large versions of thumbnail images in the same page.
Very simple, works well but not perfectly.
The thumbnails sometimes take 2 clicks before the large image appears
correctly.
Lookit : http://www.lisavallentin.com/images.html
(please excuse that the site is half complete and lacking ie css)
the script :
<script type="text/javascript">
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('picswap').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>
called like this :
<a onclick="return showPic(this)" href="images/debbie.jpg"
title="Debbie (watercolour)" ></a>
Any help would be greatly appreciated.
I'm not too hot on the js, but I'm eager to learn.
i
I'm making a site that uses only one tiny bit of javascript.
It's for opening large versions of thumbnail images in the same page.
Very simple, works well but not perfectly.
The thumbnails sometimes take 2 clicks before the large image appears
correctly.
Lookit : http://www.lisavallentin.com/images.html
(please excuse that the site is half complete and lacking ie css)
the script :
<script type="text/javascript">
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('picswap').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>
called like this :
<a onclick="return showPic(this)" href="images/debbie.jpg"
title="Debbie (watercolour)" ></a>
Any help would be greatly appreciated.
I'm not too hot on the js, but I'm eager to learn.
i