Iframe transparent background on Fancybox 2.1.4

守給你的承諾、 提交于 2019-12-13 04:21:30

问题


As per title, adding the below to remove background on Fancybox 2.1.4 works fine on Safari, FF & Chrome but not IEs. (only tested on 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)");
}

回答1:


After digging around the Fancybox's src files, the problem is at the iframe "allowtransparency" attribute.

In jquery.fancybox.js line 140, replace the line with below:

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>',


来源:https://stackoverflow.com/questions/16482779/iframe-transparent-background-on-fancybox-2-1-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!