Tooltip within an Imagemap

Here's an example of the tooltip script that I typically use:

<a class="tip_trigger" href="download_execute.php"><IMG SRC="images/duns.jpg" border="0"><span class="tip">
						<table width="300" height="100" bgcolor="white">
<b>Data Universal Numbering or DUNS# is a unique 9-digit numbers issued by Dun and Bradstreet.  The federal government's Office of Management & Budget has adopted the use of DUNS numbers as a way to keep track of how federal grant money is awarded and dispersed. 
Central Contractor Registration or CCR# (also known as CAGE Code) is a five code number that identifys entities who are authorized to do business with the federal government.</b>

Open in new window

I need to create a tooltip over each state of a map of the US. As a user mouses over each state, a tooltip needs to pop up that will be grabbing info from a database and displaying information about that particular state, so...

How can I adopt what I'm already using and have that tooltip apply to a set of x and y coordinates as opposed to an image? Or, am I better off using a different approach?
brucegustPHP DeveloperAsked:
Who is Participating?
GaryConnect With a Mentor Commented:
I don't know what tooltip plugin you are using but the logic is (assuming the HTML from the link I gave previously)

<area shape="rect" coords="207,45,267,172" class="map_tooltip" id="IL">

IL being the short code for Illinois and so on for each state

Then for your tooltip you can just use the class map_tooltip to initiate the tooltip
Set and ID or class on the anchor that you can use to reference for the tooltip
You can then dynamically set the tooltip content when you mouseover though I think it would be better to use load the data at the server - there may be too much of a delay calling the data from the server as you mouseover.
brucegustPHP DeveloperAuthor Commented:
Gary, I can trace the logic of your suggestion, but I'm not grasping the application.

If I've got:

<a class="tip_trigger" href="download_execute.php"><IMG SRC="images/duns.jpg" border="0"><span class="tip">my tooltip content</span></a>

Where am I going to put my <area shape="polygon" coords="" href="my_display.php">?

Where would all that stuff go?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.