I have a transparent PNG and want to capture clicks using map
and area
elements. Because I need the area below the transparent part to be clickable as well, I did the following:
img{
position: relative;
pointer-events: none;
}
map, area{
pointer-events: auto;
}
However, this makes the browser also ignore pointer events on the associated map. How can I fix that?
https://codepen.io/kslstn/full/jYZVmV
Note that in the Codepen, the image is not transparent, but I noticed no difference with transparent images.
Background: I'm making a 3D floor plan with floors that non-rectangular shapes. Here's an example of that setup with rectangular floors.