Solved

ImageMapster custom tooltip

Posted on 2014-11-16
4
492 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
As always, Gary that's what i was looking for! Thank you so much!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
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 …
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…

743 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

12 Experts available now in Live!

Get 1:1 Help Now