imagemapster caption/tooltip

Hello experts,

I am trying to set a tooltip with imagemapster plugin.

They have a very complicated example here:

What i am trying to do is much more simple. the tooltip should basically show a text of the area shape id. So in this example below it should simply show "5.5.1". The tooltip should show inside the area shape when hover.

If someone can just show me a very simply way to do i would be thankful.

<area shape="rect" id="5.5.1" coords="35,47,164,78" alt="" href="" target="_blank">

Open in new window

Who is Participating?

<div style="clear: both; width: 500px; height: 50px; border: 1px solid black;" id="selections"></div>
<img id="vegetables" src="" usemap="#veg">
<map id="veg_map" name="veg">
<area shape="rect" name="myshape"  coords="35,47,164,78"  href="#"> 

Open in new window

    var image = $('#vegetables');
        fillOpacity: 0.4,
        fillColor: "d42e16",
        stroke: true,
        strokeColor: "3320FF",
        strokeOpacity: 0.8,
        strokeWidth: 4,
        singleSelect: true,
        mapKey: 'name',
        listKey: 'name'

Open in new window

RefaelAuthor Commented:
Hi GaryC123

Thank you.

The jsfiddle does not work for some reason!?

The tooltip/caption should show in the highlighted area shape  and not in a div outside.
The tooltip/caption text should be simply the ID of the area shape.
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Rainer JeschorCommented:
just overwrite this function:
        onShowToolTip: function(data) {

Open in new window


Note: I set both tooltips on the area as well as only some IDs.

If I am understanding it he wants the tooltip within the actual area mapping coordinates
And an updated version
RefaelAuthor Commented:
GaryC123 Thank you. It seem to work :-)

i am trying to center the text in the area so i am adding 50% from left but it does not seem to work.
RefaelAuthor Commented:
Hi GaryC123

Thank you so much.
Because this should have been triggered when the user hover a row in a table i managed to convert it as show below. It works perfect!

var areaMapId = "area#"+newText;		
	var areaMapPosition = $(areaMapId).attr('coords').split(',');

Open in new window

RefaelAuthor Commented:
GaryC123 Thank you so much!!
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.