I want to detect the onClick
& onHover
on different parts of a image.
<img src={physicalimage} id="physicalimage" usemap="#image-map"/>
<map name="image-map">
<area target="" onClick={this.consoleMessage("bpleft")} alt="bpleft" title="bpleft" coords="223,201,269,254" shape="rect" />
<area target="" onClick={this.consoleMessage("bpright")} alt="bpright" title="bpright" coords="60,199,101,259" shape="rect" />
<area target="" onClick={this.consoleMessage("heart")} alt="heartrate" title="heartrate" coords="169,124,219,183" shape="rect" />
</map>
I use react library for developing my website. I am not able to detect the onClick
event. Are there any other alternative?
I suggested you to use a maintained library with the all feature of react-image-mapper
with extra
functionality like responsive
https://github.com/NishargShah/react-img-mapper
https://www.npmjs.com/package/react-img-mapper
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With