I am making diagrams using the jQuery Highlight Plugin (http://davidlynch.org/js/maphilight/docs/) and I currently have the diagram that is clickable and loading content based on the area you are clicking on (like simple tabs).
However, I need the map to highlight on click and disable any other highlighted areas. Right now, I can make the area highlight on click, but not disable any existing highlights. I'd also like to have the diagram switch the content on hover, but that isn't as important right now as the highlight on click.
I have my current version up for a demo: http://jsfiddle.net/keith/PVpgK/
or the fullscreen result: http://jsfiddle.net/keith/PVpgK/embedded/result/
Thanks in advance for any help
HTML Code:
JS Code
A more efficient way would be to add a class on click and remove it when clicking the next location. After adding the class you can manipulate. That way if you have hundreds or thousands of areas (as my map does) the page doesn't lock up while trying to cycle through each one.
The following link takes you to an answer that explains this. https://stackoverflow.com/a/8397900/1101054
You need to loop through the other areas and turn off the alwayson to have the last click unhighlight on a new click. Try something like this: