【问题标题】:Loading PDF in IFrame in IE6 and IE7在 IE6 和 IE7 的 IFrame 中加载 PDF
【发布时间】:2010-06-22 17:23:24
【问题描述】:

我正在弹出窗口内的 IFrame 内加载 PDF。

我在 IE6 和 IE7 中正确加载了 PDF - 但是我正在尝试解决一个问题。

当我在 IE7 的 IFrame 中加载 PDF,并从窗口右侧水平调整窗口大小时,PDF 不会缩小窗口将缩小到我无法看到 PDF 整个宽度的位置.如果我从窗口的底角调整大小,PDF 会水平调整大小/缩放。

在 IE6 中,当我从窗口的右侧水平调整大小时,PDF 会正确调整大小,并且也会从底角调整大小。

知道为什么当我在 IE7 中从弹出窗口的右侧调整大小时 PDF 没有按比例缩小吗?非常感谢任何帮助。

这是我的 IFrame 的 HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <style type="text/css">
      * {
        padding: 0;
        margin: 0;
        }
        html, body {
     width:100%;
        height: 100%;
     overflow:hidden;
        }
        #container{
        min-height: 100%;
        }
        * html #container {
        height: 100%;
        }
    </style>

</head>
<body>
    <form id="frmMine" runat="server">
        <div>
            <iframe style="min-height:500px;min-width:100%; max-width:100%;height:auto !important;" id="iframe" runat="server"></iframe>
        </div>
    </form>
</body>
<script type="text/javascript">
        function resizeIframe() {
            var height = document.documentElement.clientHeight;
            height -= document.getElementById('iframe').offsetTop;
            height -= 5;
            document.getElementById('iframe').style.height = height + "px";
        };
        document.getElementById('iframe').onload = resizeIframe;
        window.onresize = resizeIframe;
    </script>
</html>

【问题讨论】:

    标签: html css pdf cross-browser


    【解决方案1】:

    IE6 不支持min-/max- 可能解释了这种差异。至于实际完成您想要的,是否有某些原因您不使用* { width: 100%; height: 100%; overflow: hidden; margin: 0; }

    【讨论】:

      猜你喜欢
      • 2010-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多