zoukankan      html  css  js  c++  java
  • ifame高度自动适应子页面内容

    被这个问题折磨了好久,试了很多方法都不行,总算解决了,记录一下。

    <div class="iframe-pro" id="iframe-proid">
        <iframe marginwidth="0" marginheight="0" hspace=0 vspace=0 frameborder="0" name="detail" frameBorder=0 scrolling=no
                src="${base}/detail/${tempId}" onLoad="iFrameHeight()"  width="920" id="detail" ></iframe>
    </div>
    <script type="text/javascript" language="javascript">
        function iFrameHeight() {
            var ifm = document.getElementById("detail");
            var subWeb = document.frames ? document.frames["detail"].document : ifm.contentDocument;
            if (ifm != null && subWeb != null) {
                ifm.height = subWeb.body.scrollHeight;
                $('#iframe-proid').css({height:ifm.height});
            }
        }
    </script>
  • 相关阅读:
    二重循环
    汇编中的大小写转换
    编译出错:must be index or base register
    [bx]和loop指令
    poj1012约瑟夫
    fenshijin
    poj3050
    抹蛋糕
    poj1190
    uuu
  • 原文地址:https://www.cnblogs.com/codeyou/p/6495430.html
Copyright © 2011-2022 走看看