zoukankan      html  css  js  c++  java
  • iFrame在chrome中高度的问题。

            function iFrameHeight() {
                var ifm = document.getElementById("main_if");
                var subWeb = document.frames ? document.frames["main_if"].document : ifm.contentDocument;
                if (ifm != null && subWeb != null) {
                    ifm.height = subWeb.body.scrollHeight;
                    ifm.width = subWeb.body.scrollWidth;
                }
            }

     JS中加上面代码,iframe 加下面代码。

     <iframe id="main_if" src="@Url.Action("indexInfo")"  frameborder="0" scrolling="no" marginheight="0" marginwidth="0" onLoad="iFrameHeight()"></iframe>

    之前真不知道 Iframe在chrome中 还有这毛病。还是IE好。

  • 相关阅读:
    ZOJ
    CodeForces
    模板
    前门
    错误记录
    2021/1/10例会 academy of management journal 2014vol 57 No.2,484-514
    Day7下
    Day7上
    Day6 下(
    Day6上 括号匹配专项
  • 原文地址:https://www.cnblogs.com/qq22144770/p/4800320.html
Copyright © 2011-2022 走看看