0

当用户单击链接时,我试图让 maphilight 切换热点的突出显示。但是,单击链接时没有任何反应。我错过了什么?

非常感谢。代码如下。

<body>

<div class="Room">

    <div class="Wall">
        <img src="Rooms/NorthBlank.JPG" usemap="#NorthMap" border="0" class="hilight" />
        <map name="NorthMap" id="NorthMap">
            <area id="plant" shape="poly" coords="319,388,338,402,399,402,437,392,410,372,392,370,385,332,356,331,352,374" href="Objects/Plant.jpg" rel="lightbox" />
        </map>
    </div>
</div>

<div class="MenuBar">
    <a href = "#" id="InfoLink"><img id="Information" src="Icons/Info.PNG" /></a>
</div>

</body>
</html>

<script>
    $('#InfoLink').click(function(e) {
    e.preventDefault();
    var data = $('.hilight').mouseout().data('maphilight') || {};
    data.alwaysOn = !data.alwaysOn;
    $('.hilight').data('maphilight', data).trigger('alwaysOn.maphilight');
    });
</script>
4

0 回答 0