(Edited in more detail just in case anyone has a similar question)
I have an image map that should show a div when capsizing a hotspot. I have provided my areas in image map classes, and using jQuery I want to show its corresponding div, for example,
area shape="rect" coords="601,31,723,107" href="#" alt="Some Location" class="some-location"
Each area has a different location and therefore a different class name.
I'm not sure how to refer to an element with its class name stored in a variable? For example, the code I currently need to get the class name to hover over an area on the image map:
var hotspot = $(this).attr("class");
Now I want to do something like:
$(div.hotspot).show();
The above does not work - can someone point me in the right direction?
source share