http://1-large-world.com/stargate/movie/tooltip.html
Is there any way to fix the floating larger image to a set position on the
screen?
I'm no expert but the way I would do it would be a little different to how
you've got it.
The way it's done at the moment, the tooltip won't display if I have
JavaScript disabled so I would have the images actually link to a page with
the tooltip/image even if the user doesn't _have_ to click on the link to
see it.
Then, use a script similar to:
<script type="text/javascript">
<!--
function showTip(id,display)
{
if(document.getElementById)
{
if(display)
document.getElementById(id).style.display = "block";
else
document.getElementById(id).style.display = "none";
}
}
//-->
</script>
From there, your HTML would be similar to:
<div>
<a href="img1.html" onmouseover="showTip('img1',true)"
onmouseout="showTip('img1',false)"><img src="images/img1.gif"
alt="Image1"></a>
<a href="img2.html" onmouseover="showTip('img2',true)"
onmouseout="showTip('img2',false)"><img src="images/img2.gif"
alt="Image2"></a>
</div>
<div id="img1" class="hidden">
<img src="bigImg1.gif" alt="Larger Version Img1">
Tooltip text
</div>
<div id="img2" class="hidden">
<img src="bigImg2.gif" alt="Larger Version Img2">
Tooltip text
</div>
and you can use the following CSS:
<style type="text/css">
<!--
..hidden{display:none}
//-->
</style>
If you don't like that, perhaps someone else can help - or, if I've made an
error, someone will be likely to pick it up.
HTH,
Nicko.