2009-08-13 62 views
0

我正尝试使用带有区域地图的灯箱。我已经很好地使用Firefox,但在Internet Explorer中,它只是打开一个新窗口。我尝试过使用Slimbox,但它似乎根本不支持区域地图。在Internet Explorer中使用区域地图灯箱

建议?下面是HTML代码:

<div align="center"><img src="images/background-temporary.jpg" width="667" height="475" border="0" usemap="#Map" /> 
<map name="Map" id="Map"> 
    <area href="images/background-temporary.jpg" shape="poly" coords="236,396,267,396,269,428,237,429,236,396" /> 

</map> 

回答

1

哦,哇。我什么时候失去了“rel =”lightbox“”属性。我失败了。

+0

尝试编辑您的旧帖子,而不是回答您的旧问题 – 2009-08-13 16:32:26

1

这应该适用于任何浏览器,而不仅仅是IE浏览器。 在区域地图中,添加一个id标记。

<area shape="rect" id="yourid" coords="5,65,132,116" alt="Your Alt Description" /> 

在地图的外部,将这种代码添加到html中,并在空标记中添加一个id。

<a href="an_image.jpg" rel="lightbox[a]" Title="My title"><span id="empty_span"></span></a> 

使用JavaScript,做这样的事情

<script> 
    $('area').click(function(){ 
     $("#empty_span").click(); 
    }); 
    </script> 

为多个区域,你可以创建多个点击功能或数在两个区域标签和点击功能的IDS - 如下:

<map etc.... 
    <area shape="rect" id="id1" coords="5,65,132,116" alt="1st Description" /> 
    <area shape="rect" id="id2" coords="55,65,132,116" alt="2nd Description" /> 
    <area shape="rect" id="id3" coords="105,65,132,116" alt="3rd Description" /> 
    </map> 

    <a href="1st_image.jpg" rel="lightbox[a]" Title="1st title"><span id="span1"></span></a> 
    <a href="2nd_image.jpg" rel="lightbox[a]" Title="2nd title"><span id="span2"></span></a> 
    <a href="3rd_image.jpg" rel="lightbox[a]" Title="3rd title"><span id="span3"></span></a> 

    <script> 
    $('area').click(function(){ 
      $("#span"+$(this).attr("id").substr(2)).click(); 
    }); 
    </script>