<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/imagemapster/1.6.0/jquery.imagemapster.min.js"></script>
<div>
<p><b>ImageMapster Group Example</b> <code><a href="#" class="showhide">[hide]</a></code> or scroll down to the interactive map below</p>
</div>
<div class="box">
<div class="box-inner">
<p>This example shows how to use <code>mapKey</code> to create groups that you can use to control sets of areas independently. </p>
<ul class="accordion">
<li>Each area in the imagemap has a custom attribute <code>data-state</code>. This defines the groups that each area belongs to.</li>
<li>The <code>mapKey: 'data-state'</code> option says that an attribute called <code>data-state</code> on each <code>area</code> tag will define this the groupings of areas. Areas that share the same value are considered part of a group, and will be highlighted toghether. These values in the mapKey can be used to select, deselect or highlight areas or groups of areas from code. </li>
<li>Areas can belong to more than one group. In this example, New England states belong to three groups: a state code like "ME", the group "new-england", and possibly the group "really-cold".</li>
<li>Options can be set for area groups. These options only apply when the group is activated using its group name. Notice if you click a New England state, it's red (like the other states) but when you activate it using "new-england" it's green, and with "really-cold", it's blue.</li>
<li>When you mouse over an area, the first group in the list determines what gets highlighted. In this example, most states are actually defined by more than one <code>area</code> HTML element. The first value of <code>data-state</code> is the state code, ensuring that when you mouse over a state, all the different areas that make it up get highlighted together, even if they aren't connected. New...