zoukankan      html  css  js  c++  java
  • Iframe 高度自适应

              <script language="javascript" type="text/javascript">
            function iframeAutoFit(iframeObj) {
                setTimeout(function () {
                    if (!iframeObj) return;
                    iframeObj.height = (iframeObj.Document ? iframeObj.Document.body.scrollHeight : iframeObj.contentDocument.body.offsetHeight);
                }, 200)
                document.getElementById('tr-iframe').style.display = 'block';
            }
        </script>
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr id='tr-iframe' style='display: none'>
                    <td>
                        <iframe allowtransparency="true" src="" frameborder="0" height="100" width="100%"
      style='background-color:transparent;filter:alpha(opacity=100);'     scrolling="no" align="center" id="frameid" name="framename" onload="javascript:iframeAutoFit(this)"
                            vspale="0"></iframe>
                    </td>
                </tr>
            </table>
            function SetWinHeight(obj) {
                var win = obj;
                if (document.getElementById) {
                    if (win && !window.opera) {
                        if (win.contentDocument && win.contentDocument.body.offsetHeight)
                            win.height = win.contentDocument.body.offsetHeight;
                        else if (win.Document && win.Document.body.scrollHeight)
                            win.height = win.Document.body.scrollHeight;
                    }
                }
            }
  • 相关阅读:
    共用体
    位运算符和位运算
    python中while循环
    c语言中求多个整数的和及其平均值
    c语言中switch语句
    python中删除列表中多次重复的元素
    python中while循环
    python中break语句
    使用用户输入来填充字典
    python中while循环使用标志
  • 原文地址:https://www.cnblogs.com/gzh4455/p/3021617.html
Copyright © 2011-2022 走看看