小编Pab*_*ath的帖子

如何在 React 中的图像映射中检测区域标记 onClick

我想检测图像不同部分的onClick& onHover

<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>
Run Code Online (Sandbox Code Playgroud)

我使用反应库来开发我的网站。我无法检测到该onClick事件。还有其他选择吗?

html image imagemap reactjs

5
推荐指数
1
解决办法
6064
查看次数

标签 统计

html ×1

image ×1

imagemap ×1

reactjs ×1