2011-12-28 33 views
2

我在內聯內容中使用JQuery ColorBox,這在大多數瀏覽器中似乎都能正常工作,但是當我在IE8中使用它時,首次加載罰款,然後內容的iFrame部分不顯示?使用jQuery的iFrame IE8 ColorBox

我檢查了源代碼,並且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> 

回答

0

直到修復被發現,就可以使IE8加入這個元標記的頭部分效仿IE7您頁

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

這似乎沒有工作。它似乎已加載的iframe和'認爲'內容被加載,但只顯示爲白色,如果我右鍵點擊iframe並刷新它的作品? – 2011-12-28 12:55:53