Lightbox代码在Chrome / Firefox中运行良好,但在IE中则不行

时间:2011-07-14 14:38:22

标签: javascript internet-explorer joomla

我在其中一张图片上添加了一些“灯箱”效果代码(如下所示)website正在播放],这会打开YouTube视频。

Lightbox Image

插件名称为YOOeffects

这是设置的代码。

<p>
    <span id="avrpopup_eBay Marketplace" title="{handler:'iframe',size:{x:1024,y:768},url:'index.php%3Foption%3Dcom_avreloaded%26view%3Dpopup%26Itemid%3D25%26divid%3DeBay+Marketplace'}"></span>
    <a href="#" onclick="AvrPopup(event, 'eBay Marketplace', 'lightbox');">
        <img alt="120top_tips" src="/images/stories/content-images/120top_tips.jpg" height="186" width="150">
    </a>
</p>

它适用于Chrome和Firefox,但似乎在IE中扩展并看起来变形。

不确定原因,是否需要在Internet Explorer中应用任何特定的修复程序?

2 个答案:

答案 0 :(得分:1)

我建议你尝试'默认'joomla创建弹出窗口的机制。 这很容易实现。为了使其工作,只需在代码

之后将此代码添加到模板中
JHTML::_('behavior.modal');

并将类'modal'添加到应该打开弹出窗口的链接。 http://www.jeepstone.co.uk/2009/03/06/open-content-in-a-modal-pop-up-in-joomla/ 我希望这能帮到您。如果没有 - 抱歉浪费你的时间。

<强> UPD

您的设置代码与demo

中的设置代码不同
<a rel="ligthbox;width=405;height=340" title="1984 Apple's Macintosh Commercial" href="http://www.youtube.com/v/OYecfV3ubP8&amp;autoplay=1">YouTube</a>

为什么你没有使用教程中的代码? 函数AvrPopup('....')做了什么?

答案 1 :(得分:1)

我不确定该插件是否支持IE≤7,可能应该如开发人员所说,但似乎问题在于将IE切换到不同的document mode(在IE8的情况下) )并同时使用javascript库 - IE8.js, claiming: "it makes IE behave like a standard-compliant browser",它似乎与此插件不兼容(或者更确切地说,插件不计入此库)。因此,为了使其工作,请尝试删除此条件注释:

[第39行]

<!--[if lt IE 8]>
<script src="/templates/actinic/js/IE8.js" type="text/javascript"></script>
<![endif]-->

或者可能删除这个元元素(这应该有助于使其至少在IE8下工作):

[第5行]

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
相关问题