0

我一直在边栏上工作,上面写着点击下面的游戏列表http://www.bespoke-arcades.co.uk/store/arcade-machines/16-synergy-elite-arcade-machine.html左手边。

我有一个图像映射,因为我宁愿下载一个图像而不是一吨(因为它会减慢加载时间)。

但是图像映射不允许我class="iframe"<area>标签中使用。如果我这样做<a href="xxx" class="iframe"><img src="yyy" /></a>,它将工作并打开一个fancybox iframe 弹出窗口,但如果我使用图像映射,则该class="iframe"功能不会被真正接受。

是否有任何解决方法可以使这项工作?我在有问题的页面上有fancybox js和css。如果我使用该class功能,我也有正确的 javascript 工作。

4

1 回答 1

0

Try changing this :

<script type="text/javascript">
$('a.iframe').fancybox();
</script>

by this :

<script type="text/javascript">
jQuery(document).ready(function($){
    $('area.iframe').fancybox({
        "type":"iframe",
        "width": 600, // or whatever
        "height": 380
    });
});
</script>

... of course, don't forget to add class="iframe" to each area tag.

Also check this answer or this for further reference.

于 2013-06-04T17:07:33.920 回答