Toggling off selected areas when hovering on new areas or selecting a new area.
I am using jQuery Maphilight to hilight selected areas on a map. I have successfully added a click state, so the area of the map remains hilighted when a user clicks it. But when they click a second and third area, the 1st area remains highlited which I don't want.
How can I toggle this alwaysOn attribute for all elements to turn off. I can't seem to figure it out.
Thanks.
.bind('click.maphilight', function(e) {
e.preventDefault();
var data = $(this).mouseout().data('maphilight') || {};
data.alwaysOn = !data.alwaysOn;
$(this).data('maphilight', data).trigger('alwaysOn.maphilight');
})