【问题标题】:iFrame IE8 using jQuery ColorBox使用 jQuery ColorBox 的 iFrame IE8
【发布时间】:2012-01-29 03:51:55
【问题描述】:

我正在使用带有内联内容的 JQuery ColorBox,在大多数浏览器中似乎都可以正常工作,但是当我在 IE8 中使用它时,它第一次加载正常,然后内容的 iFrame 部分不显示?

我已经检查了源代码,并且 iframe 在 html 中正确呈现。我在服务器端使用 asp.net 3.5 和 c#。

服务器端代码:

<script>

   jQuery(document).ready(function () {

            jQuery.fn.colorbox({ width: 376, inline: true, href: "#LightBox" });


        });
</script>

<div style='display:none'>
    <div id='LightBox' style='padding:10px; background:#fff;'>  
    <sc:Image runat="server" ID="imgBanner" Field="Banner" MaxWidth="346" />
    <sc:Text runat="server" ID="txtContent" Field="Content" />
    <iframe runat="server" id="iFrm" height="220px" scrolling="no" frameborder="0" />
   <img src="/images/loading.gif" alt="loading" id="preload-img" />
    </div>
    </div>

客户端:

    <div style='display:none'>
    <div id='LightBox' style='padding:10px; background:#fff;'>  

    <img src="~/media/Images/Premier/newsletters/ignite/header_4.ashx?mw=346" alt="Ignite" width="346" height="132" />
    <p><strong>Free e-newsletter from Premier</strong> </p>
<p>Hot topics impacting your life today...</p>
<p>You are invited to receive <strong>Ignite</strong>, the UK's leading Christian <br />e-publication, 
dealing with the hottest issues of our day: from abortion, to going 'green', to the debate over homosexuality.</p> 
<p>To receive your free weekly subscription to <strong>Ignite</strong> fill in your details below.</p>
    <iframe id="content_10_iFrm" height="220px" scrolling="no" frameborder="0" src="http://email.premierchristianmedia.co.uk/premierradiolz//WebCapture.aspx?pID=334&amp;t=0"></iframe>
   <img src="/images/loading.gif" alt="loading" id="preload-img" />
    </div>
    </div>

【问题讨论】:

    标签: c# jquery asp.net iframe colorbox


    【解决方案1】:

    在找到修复程序之前,您可以通过将此元标记添加到页面的 head 部分来使 IE8 模拟 IE7

    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
    

    【讨论】:

    • 这似乎不起作用。它似乎已加载 iframe 并“认为”内容已加载但仅显示为白色,如果我右键单击 iframe 并刷新它可以工作???
    猜你喜欢
    • 2012-03-24
    • 1970-01-01
    • 2017-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多