I have lots of identical images which share a common map:
<map name="mymap">
<area shape="polygon" coords="0,0,64,0,32,32" href="ref1">
<area shape="polygon" coords="64,0,64,64,32,32" href="ref2">
</map>
<img src="image.jpg" usemap="#mymap">
<img src="image.jpg" usemap="#mymap">
and I would like the followed link to depend on:
1. which image was clicked,
2. where in the image the click was.
Above, I differentiate the locations in the image, but I wonder if there is a way to do something different depending on which image was clicked?
You could write some JavaScript to clone the map, rename it and assign it to a list of images.
or
Capture the mouse click coordinates and determine where the click is is relation to which image. If they’re in a row you only need to check one coordinate.
You can trigger JavaScript using the href: