View Single Post

Javascript Question
Old 10-02-2008, 03:44 AM   #1  
IceBlade
IceBlade's Avatar
Forum Nazi
 
IceBlade is Offline
Join Date: Aug 2006
Location: Calgary
Posts: 3,559
Default Javascript Question

Okay this is what I have so far. It's pretty simple although I know nothing about this stuff so it took me hours to get this far. Anyways. What I want to do is have the text it displays on mouseover to show up on the right of the image rather than displaying on the bottom. So when I mouseover I want the [1,1], [1,2], etc. to show up on the right of the image.. preferably vertically centered.

What would really be ideal is if I could get the text to shop up at the current mouse position like under the cursor. Is that possible? Help please?

Code:
<html> <head> <script type="text/javascript"> function writeText(txt) { document.getElementById("desc").innerHTML=txt; } </script> </head> <body> <img src="IkariamMap_01.gif" width="680" height="680" alt="Coords" usemap="#ikimap" /> <map id ="ikimap" name="ikimap"> <area shape ="rect" coords ="20,20,40,40" onMouseOver="writeText('[1,1]')" href ="island1.htm" target ="_blank" alt="1,1" /> <area shape ="rect" coords ="40,20,60,40" onMouseOver="writeText('[1,2]')" href ="island2.htm" target ="_blank" alt="1,2" /> <area shape ="rect" coords ="60,20,80,40" onMouseOver="writeText('[1,3]')" href ="island3.htm" target ="_blank" alt="1,3" /> </map> <p id="desc"></p> </body> </html>

Last edited by IceBlade : 10-02-2008 at 03:47 AM.
  Reply With Quote