Hi robbycoats1-ga,
I had to look this one up, but I was able to find the answer to your
question in the W3C definition of the MAP element:
http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#edef-AREA
Here is a sample of how to use it to achieve what you described:
<IMG SRC="myimage.gif" usemap="#map1">
<MAP name="map1">
<AREA alt="Place descriptive text here for this rectangular area."
shape="rect"
coords="0,0,0,0">
<AREA alt="Place descriptive text here for another rectangular area."
shape="rect"
coords="100,0,200,100">
<AREA alt="Place descriptive text here for a circular area."
shape="circle"
coords="160,160,60">
<AREA alt="Place descriptive text here for a polygon."
shape="poly"
coords="276,0,276,28,100,200,50,50,276,0">
</MAP>
Note that, unlike the W3C example, I have removed the HREF attributes
from all of the map areas. This means that the areas do not have any
links to other pages.
Essentially, what is required to accomplish tooltip display that
varies on different areas of an image map is the use of the ALT
attribute for each area in the map.
A tooltip that "follows" the mouse while it's moving is a good deal
more complex, and cannot be achieve without some rather complicated
code. This code will display a normal tooltip, where the mouse is
placed on an area of the image and left there (for 1-2 seconds).
Moving the mouse again will hide the tooltip again until it is once
again positioned over an area with ALT text defined.
I tried out the solution above with a fairly large piece of text and
it was able to display it without any problem. A paragraph-size piece
of text will display without a problem.
Hopefully that should answer your question - if you require any
clarification please let me know. I will attempt to respond promptly.
Thank you for using Google Answers :)
Cheers!
answerguru-ga |