-
Notifications
You must be signed in to change notification settings - Fork 331
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
Grouping area and divs for mouseenter/mouseleave #190
Comments
Some free-form thinking how to support this feature.
Is there a particular reason to add mouseover and mouseout events to each area, even if highlighting is disabled? Could ImageMapster be changed so that:
Would you accept a patch with this change, or would such change pose unexpected side-effects? |
This allow external methods to control the highlight status, just as it is possible to set isSelectable to false, and control the selection status from external methods. Effectively, mouseover() and mouseout() no long call the highlight() and clearEffects() methods if the highlight option is false. Also, the highlight() method now highlights the area, regardless of the highlight option. See jamietre#190.
You can test that this at: http://jsfiddle.net/macfreek/SLa95/3/ While all tests in imagemapster-test-runner.html pass, it wouldn't hurt to check how this works, in particular when combining selections and highlights. FYI, I converted the dist file to contain MS-DOS line-breaks only, so I could push that too. |
Would it be possible to disable automatic highlight events upon mouseover/mouseout events?
I have a imagemap with small textboxes to add some additional information (kind of like tooltips, but sticky). In code:
Ideally, I like the area and div to behave as if it was one area. This is similar to a areagroup with a boundList. Unfortunately, the items in an boundList do not automatically highlight or select. This needs to be programmed.
See for example http://jsfiddle.net/macfreek/SLa95/1/
Unfortunately, there is a rather annoying 'flickering' when moving the cursor between div and area. This is caused by a mouseout from one element and a subsequent mouseover from the other element. This is particular visible if the highlight fade is set to a high value (in the above example 0.5 sec).
The common solution is to group the elements, and use mouseenter/mouseleave instead of mouseover/mouseout.
See for example http://jsfiddle.net/macfreek/SLa95/2/
Unfortunately, while the mouseenter/mouseleave take care of everything, ImageMapster still fires redundant mapster('highlight', null) events, causing un-highlighting when moving the mouse from an area to a div.
Would it be possible to disable automatic highlights (from mouseover/mouseout events), and so everything manually?
The text was updated successfully, but these errors were encountered: