den*_*xic 5 jquery image map area
我正在尝试对鼠标悬停图像映射区域执行操作.这是我的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>
Run Code Online (Sandbox Code Playgroud)
这是我的js:
$('.mapping').mouseover(function() {
alert($(this).attr('id'));
}).mouseout(function(){
alert('Mouseout....');
});
Run Code Online (Sandbox Code Playgroud)
我不明白为什么,但jquery只针对第一个区域而不是其他区域启动.任何帮助将不胜感激.
谢谢.
| 归档时间: |
|
| 查看次数: |
23817 次 |
| 最近记录: |