Scenario:
I have a state map of the USA. Over top of the state map, I have manufactured an area map to make each state a clickable link. Over each state, I have a <div>
with absolute position and CSS styling to make the <div>
look like a callout or tooltip box -- containing information about the address and website of the head office in each specific state.
So, yes, I have 50 different <div>
s with absolute positioning that are currently set to "visibility:hidden".
What I am trying to accomplish:
When you click on a specific link from the area map, the <div>
for that US state will appear in the appropriate location. Furthermore, when you click on the exact same state the <div>
will hide, or when you click on a different state the all of the <div>
s hide, and the proper <div>
for the new state will appear.
I would prefer to do this in simple Javascript (not Jquery) as ultimately the page will be loaded in a website with a Drupal CMS.
Please help. I'd rather not code each state as a button and write fifty different segments of javascript code.