【发布时间】:2011-10-22 07:43:45
【问题描述】:
我正在尝试对图像地图区域的鼠标悬停执行操作。这是我的 HTML:
<img src="img/denisanddavid-bkgd.jpg" alt="Denis and David - web development and solution" width="1024" height="1299" border="0" usemap="#bkgdMap" id="bkgd" />
<map name="bkgdMap" id="bkgdMap">
<area shape="rect" coords="12,161,341,379" href="#" alt="qdk" id="qdk" class="mapping" />
<area shape="rect" coords="347,162,675,379" href="#" alt="gifgif" alt="gifgif" class="mapping" />
</map>
这是我的 js:
$('.mapping').mouseover(function() {
alert($(this).attr('id'));
}).mouseout(function(){
alert('Mouseout....');
});
我不明白为什么,但是 jquery 只针对第一个区域而不是其他区域启动。任何帮助将不胜感激。
谢谢。
【问题讨论】: