我有一个imagemap并使用以下
$('area').hover(function(e) {
问题是ie7和8没有检测到区域标签的悬停事件。有解决方法吗?
答案 0 :(得分:0)
我创建了一个简单的演示,试图重现您的问题,但似乎工作正常。我使用IE9但通过集成的开发人员工具更改了浏览器模式来测试IE7和IE8。
<强> HTML 强>
<img src="http://placekitten.com/g/400/400" width="400" height="400" alt="Kitten" usemap="#areamap" />
<map name="areamap" id="areamap">
<area shape="rect" coords="100,100,300,300" href="#top" alt="Top" id="area1" />
</map>
<强>的Javascript 强>
$('area').hover(
function(event) { console.log(event.type, this.id); },
function(event) { console.log(event.type, this.id); }
);
自行试用