Solved

ImageMapster custom tooltip

Posted on 2014-11-16
4
518 Views
Last Modified: 2014-11-17
Hello Experts,

For those who are familiar with ImageMapster .........

The below is my current script that basically position the mouse-over tooltip at the center of the selected map area.
Now i facing a new requirement to position the tooltip absolute over the selected map area 5 pixels above (like every normal tooltip works). I was trying editing the current positioning but no luck getting it to work.

Any help form someone who understand this script below would be very much appreciated.

var areaMapPosition = $(areaMapId).attr('coords').split(',');

$("#tooltip").css({top:areaMapPosition[1]+"px",left:areaMapPosition[0]+"px", "line-height": areaMapPosition[3]-areaMapPosition[1]+4+"px" }).html(text).width(areaMapPosition[2]-areaMapPosition[0]+"px").height(areaMapPosition[3]-areaMapPosition[1]+"px").show();

Open in new window

0
Comment
Question by:Refael
  • 2
  • 2
4 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40446405
Where does...
absolute over the selected map area 5 pixels above
...put the tooltip?
In relation to the cursor or the map segment?
0
 

Author Comment

by:Refael
ID: 40446778
Hi Gary. Thank you for you comment.

Currently the script above position the tooltip in the center of each map area.
The relation is to the each map area  (not the cursor).

I do not understand how the second line i posted above that deals with the position of the tooltip. Currently the tooltip is positioned in the center of each map area now i need to position it so above it. If you can explain the positioning in the second line i posted above (it was your solution last year) I might be able to do that alone :-)

Thank you again!
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40447829
TBH I don't remember it, it looks to be getting whatever the position of the map segment is and splitting it, is the page online?

So the tooltip should show just above where the cursor happens to be?
You would need to get the position of the mouseX and mouseY when moving the mouse

Simple example showing how to pass the coordinates when hovering the map (div)
http://jsfiddle.net/7xLrq8dq/1/

Then use them instead of areaMapPosition[]
0
 

Author Closing Comment

by:Refael
ID: 40448324
As always, Gary that's what i was looking for! Thank you so much!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now