我试图让 maphilight jQuery 插件允许我在鼠标悬停时执行操作,但我似乎无法让它工作并且仍然允许突出显示。
到目前为止,这是我的代码:
var j = jQuery.noConflict();
j(document).ready(function() {
j('.mapF').maphilight({ stroke: true, fillColor: 'FF0000', fillOpacity: 0.2 });
j('.areaH').hover(function (e) {
alert('1');
}, function() {});
});
<img src="img.jpg" usemap="#map" class="mapF">
<map name="map" class="mapH">
<area shape="poly" coords="161,64,226,7,273,44,211,88,160,65" href="#" mystuff="img1.jpg" class="areaH" />
<area shape="poly" coords="3,269,5,282,11,296,24,315,41,326,49,329,58,329,58,339,0,339,0,272,3,270" href="#" />
<area shape="poly" coords="231,328,368,328,369,345,230,345" href="#" />
<area shape="poly" coords="293,204,297,228,298,251,281,252,280,265,243,264,243,261,231,261,231,226,292,204" href="#" />
<area shape="poly" coords="306,199,370,175,369,231,309,231,305,199" href="#" />
<area shape="poly" coords="362,106,379,158,515,104,498,58,435,88,417,85" href="#" />
<area shape="poly" coords="48,163,73,194,17,237,18,223,29,197,48,164" href="#" />
</map>
好的,悬停是有效的,但它会从 Hilight 插件中夺走控制权,并且该区域不再突出显示。
我怎样才能让它工作,我想实际运行整个函数并出现一个弹出窗口但保持对象突出显示。
有什么想法吗?