与Internet Explorer的Fancybox Iframe错误

时间:2022-03-19 15:56:11

I'm getting a bug with Internet Explorer. The iframe doesn't have correct size and it is displayed on the top left of the page instead of the center.

我收到了Internet Explorer的错误。 iframe的大小不正确,它显示在页面的左上角而不是中心。

In Firefox and Chrome, everything is working perfectly.

在Firefox和Chrome中,一切都运行良好。

Tried many things but I couldn't find a solution :(

尝试了很多东西,但我找不到解决方案:(

Please help me.

请帮帮我。

You can see the bug in IE8 here: http://www.ni-dieu-ni-maitre.com/v2/index_v2.php Click link labelled "iframe" on top left

你可以在这里看到IE8中的错误:http://www.ni-dieu-ni-maitre.com/v2/index_v2.php点击左上角标有“iframe”的链接

Here's a screenshot of what it looks like:

这是一个截图:

与Internet Explorer的Fancybox Iframe错误

Here's my code:

这是我的代码:

<head>
    <script type=\"text/javascript\" src=\"http://www.$domain/scripts/jquery-1.8.2.min.js\"></script>
    <script type=\"text/javascript\" src=\"http://www.$domain/scripts/jquery.fancybox.js?v=2.1.1\"></script>
    <link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.$domain/scripts/jquery.fancybox.css?v=2.1.1\" media=\"screen\" />

    <script type=\"text/javascript\">
        $(document).ready(function() {
            $('.fancybox').fancybox();

            $('.fancybox').click(function() {
                $.fancybox.open({
                    href : 'iframe.html',
                    type : 'iframe',
                    padding : 5,
                    autoScale : false
                });
            });

    $(\".contactbox\").fancybox({

        openEffect : 'elastic',
        openSpeed  : 150,
        closeEffect : 'elastic',
        closeSpeed  : 150,
        closeClick : true,
        'overlayShow'    :    false,
        href : 'contact.php',
        type : 'iframe',
        padding : 5,
        autoScale : true,
        scrolling : 'no'
        frameWidth : 430,
        frameHeight : 380
    });

        });
    </script>

</head>
<body background=\"$background\" id=\"top\">

<a class=\"contactbox\" href=\"http://$domain/contact.php\">Iframe</a>

1 个解决方案

#1


4  

Your page is rendered in quirks mode because you don't have a correct HTML DTD declaration.

您的页面以怪异模式呈现,因为您没有正确的HTML DTD声明。

与Internet Explorer的Fancybox Iframe错误

If you bring up IE dev toolbar (F12), you can see it renders correctly in standards modes.

如果您打开IE开发工具栏(F12),您可以看到它在标准模式下正确呈现。

#1


4  

Your page is rendered in quirks mode because you don't have a correct HTML DTD declaration.

您的页面以怪异模式呈现,因为您没有正确的HTML DTD声明。

与Internet Explorer的Fancybox Iframe错误

If you bring up IE dev toolbar (F12), you can see it renders correctly in standards modes.

如果您打开IE开发工具栏(F12),您可以看到它在标准模式下正确呈现。