【问题标题】:Iframe transparent background on Fancybox 2.1.4Fancybox 2.1.4 上的 iframe 透明背景
【发布时间】:2013-05-10 12:56:17
【问题描述】:

根据标题,添加以下内容以删除 Fancybox 2.1.4 上的背景在 Safari、FF 和 Chrome 上运行良好,但在 IE 上运行良好。 (仅在 IE8 上测试过)

beforeShow: function(){
    //transparent background
    $(".fancybox-skin").css("background","transparent");

    //remove dropshadow
    $(".fancybox-skin").css("-webkit-box-shadow","0 0 0 rgba(0, 0, 0, 0)");
    $(".fancybox-skin").css("-moz-box-shadow","0 0 0 rgba(0, 0, 0, 0)");
    $(".fancybox-skin").css("box-shadow","0 0 0 rgba(0, 0, 0, 0)");
}

【问题讨论】:

  • rgba 颜色在 IE8 中不受支持。解决方案请阅读CSS background opacity with rgba not working in IE 8
  • 您在使用哪个版本的 Internet Explorer 时遇到问题?旧版本本身不支持 rgbabox-shadow 等功能。
  • rbga是去掉阴影,不是背景色。
  • 尝试 diff 后找到解决方案。设置,stackoverflow 不允许我在 6 小时内发布答案,之后会发布详细信息。问题在于 iframe 属性:必须设置为 allowtransparency="true"。

标签: internet-explorer iframe background transparent fancybox-2


【解决方案1】:

在研究了 Fancybox 的 src 文件后,问题出在 iframe 的“allowtransparency”属性上。

在 jquery.fancybox.js 第 140 行,将行替换为以下行:

iframe   : '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen allowtransparency="true"></iframe>',

【讨论】:

    猜你喜欢
    • 2021-09-20
    • 2011-07-05
    • 2013-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-02
    • 2010-11-22
    • 1970-01-01
    相关资源
    最近更新 更多