我正在尝试禁用图像映射 onClick - 如果重新单击,最终我想启用它,但首先要做的是。
因此,要禁用 imaeg 地图,我想在单击地图时从图像中删除属性“usemap”。
在标题中,我调用了我的 JQuery:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="jq/jquery.maphilight.js"></script>
<script>
$(function() {
$('.map').maphilight();
});
</script>
下面我尝试使用 .removeAttr 但我没有得到回报:
<div class="mapholder"><img class="map" src="img/map.png" width="517" height="352" border="0" usemap="#usa" /></div>
<script>
$("img.map").toggle(function(){
$(this).removeAttr("usemap")
.focus()
},
function(){
$(this).addAttr("usemap")
.focus()
});
</script>
这是测试站点:http: //quiznosforsale.com/open_house/
地图在底部,任何建议将不胜感激!