使用jQuery ColorBox的iFrame IE8

时间:2011-12-28 12:17:40

标签: c# jquery asp.net iframe colorbox

我使用的JQuery ColorBox内联内容似乎在大多数浏览器中都能正常工作,但是当我在IE8中使用它时,首次加载时会很好,然后内容的iFrame部分才显示?< / p>

我检查了源代码,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>

1 个答案:

答案 0 :(得分:0)

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

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