3 ms·
If image maps only allowed rectangular areas, they wouldn't be terribly useful — you're right that it would be almost as easy to lay some transparent divs over
by perilunar 6y ago
If image maps only allowed rectangular areas, they wouldn't be terribly useful — you're right that it would be almost as easy to lay some transparent divs over the image.
However... image maps also allow for circular and polygonal regions, which can be really handy.
I guess you could also do that with a transparent SVG overlay, but using a map is easier.
- kevsim 6y agoRight, but in this example, the author is laying divs on top of the map areas, and those need to be rectangles.
- Sharlin 6y agoThe annotation divs have to be rectangles, but the mouse/touch-sensitive areas of the underlying image don't! The author's goal is to only show an annotation if the user hovers over/touches its corresponding region in the image map.