c# - iFrame IE8 使用 jQuery ColorBox

标签 c# jquery asp.net iframe colorbox

我正在使用带有内联内容的 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>

最佳答案

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

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

关于c# - iFrame IE8 使用 jQuery ColorBox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8655825/

相关文章:

c# - 如何在没有 ASP.NET 模型验证的情况下根据需要在 Swagger 中标记属性?

C#构建生成PDB文件和obj文件夹

c# - 如何链接到通过 Click Once 部署的 DLL

c# - 检查电话号码是否有效/真实

javascript - jQuery .animate() 不工作

c# - HttpRuntime.Cache 的范围

c# - C#中的FNT字体文件

javascript - 鉴于现有答案,更改 DatePicker 中的 minDate 选项不起作用

javascript - JS 计数带千位分隔符的数字

asp.net - .Net LoginControls - 用户无法在 Firefox 中注销