Solved

ImageMapster custom tooltip

Posted on 2014-11-16
4
581 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
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…
The viewer will learn how to dynamically set the form action using jQuery.
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…

730 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