0

我想为几个不同的图像重用一个图像映射。例如,我希望 Javascript 能够知道我点击了 image3 的区域 2。这可能使用Javascript吗?如果是这样,我如何将图像 ID 传递给 Javascript?谢谢!

<map name="bg_over" id="bg_over">
<area shape="poly" coords="2,44,44,2,44,44" href="team2.html" alt="" />
<area shape="poly" coords="0,0,0,43,44,0" href="team1.html" alt="" />
</map>

<a href="#"><img src="/Training/rumble_ora/images/bg.gif" width="44" height="44" id="image1" name="image1" usemap="#bg_over"></a>
<a href="#"><img src="/Training/rumble_ora/images/bg.gif" width="44" height="44" id="image2" name="image2" usemap="#bg_over"></a>
<a href="#"><img src="/Training/rumble_ora/images/bg.gif" width="44" height="44" id="image3" name="image3" usemap="#bg_over"></a>

4

0 回答 0