Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tooltip positioning/links inside tooltips #154

Open
cyungmann opened this issue Aug 6, 2013 · 1 comment
Open

tooltip positioning/links inside tooltips #154

cyungmann opened this issue Aug 6, 2013 · 1 comment

Comments

@cyungmann
Copy link

Hello, and thanks for this great plugin! I was wondering if there is a way to position the tooltips yet, as mentioned in issue #16.

My exact use case is this: I am displaying links inside the tooltips. I wish for the tooltips to be activated when the user hovers over certain areas. However, as these areas are adjacent to each other it becomes difficult to click the links without accidentally going over another area.

Thanks!

@cyungmann
Copy link
Author

I managed to get what I wanted using something like the following (example code excerpt):

img.mapster({
  onMouseover: function(e) {
    pageX = e.pageX;
    pageY = e.pageY;
  },
  onShowToolTip: function(e) {
    e.toolTip.css({ left: '5px', top: '0px' });
  }
});

I was originally planning on basing the position on the mouse position, hence the onMouseover callback. I was a little surprised that it does not seem the position is accessible in the onShowToolTip callback object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant