1

I am using imagemapster to add some effects to an image map, it would be really awesome if I could cancel the hover effect for areas that are selected, is that possible?

edit: I am referring to http://www.outsharked.com/imagemapster/

Mircea Sandu
  • 926
  • 7
  • 21
  • why are you people downvoting? at least comment so I know if I asked something wrong... – Mircea Sandu Apr 18 '13 at 12:36
  • anyway, I managed to block the hover effect by using the "class" property as 'mapKey' and then add a class when the area is selected and remove it if the area is deselected, now I get an error 'Cannot set property 'area' of undefined' and I can't really figure out why. Maybe it's worth mentioning that I set isSelectable: false for all areas and I select them using the 'set' method in an ajax callback (to be in sync with the server ) – Mircea Sandu Apr 18 '13 at 12:42

2 Answers2

0

Okay, so I finally managed to obtain the effect I was talking about.

First I used this in the main .mapster() options:

    onMouseover: function(data) {
        if ( data['selected'] !== true ) {
            $('#bgartisti').mapster('highlight', data['key']);              
        }
    },

And this didn't work, because if you set highlight : false it disables them completely, as opposed to isSelectable ( like in the comment I added to the question ). So I commented the hover completely to manage it manually. I did that by commenting the statement at line 2725 in jquery.imagemapster.js

Mircea Sandu
  • 926
  • 7
  • 21
0

For selected area

    onMouseover: function (e) {
        if (!e.selected) {
            $(this).mapster('deselect');
        }
    }

For all areas

     onMouseover: function (e) {
        if (!e.selected) {
            $("#imageID").mapster('deselect');
        }
     }

This may solve your problem.