I am trying to get an image popup of a flag when the cursor is over a hotspot on an imagemap. The part that I can’t get to work sufficiently is the position of the image relative to the mouse pointer or hotspot. I want the image to pop up close to the hotspot regardless of the user resizing the browser window. What I get is it appears further away when the window is resized larger or slightly to the left when the widow shrinks. Here is what I have so far:
'<!-- Script adapted from Internet search -->'
'<script type="text/javascript">'
'function displayImage(imgid)'
'{document.getElementById(imgid).style.display ='block';}'
'function hideImage(imgid)'
'{document.getElementById(imgid).style.display ='none';}'
'</script>'
'<div id= "wrap" style="position: relative;">'
'<p><img src = "../images/world-map.jpg" width=800 height=480 usemap="#ImgMap0" /></p>'
'<map id="ImgMap0" name="ImgMap0">'
'<area shape="circle" coords="188, 402, 10" href="elliot_history.html"onMouseOver="displayImage'('nz')"onMouseOut="hideImage('nz')" alt="New Zealand" />'
'</map>'
'<img class="hidden" id="nz" src="../flags/nz.jpg">'
'</div>'
Navy.css file:
'/* Image Map styles */'
'#empty{position:absolute; z-index:12;}'
'#ImgMap0{position:absolute;}'
/* Styles for the Flags */
'#nz{'
'position:absolute;'
'left:280px;'
'top:290px;}'
I tried making the position of #nz relative but then it disappears below the image map.
My page is here: http://www.eta-carina-ltd.com/page7/navy/map.html