zoukankan      html  css  js  c++  java
  • iframe自适应兼容

    页面代码:
    <div style="border:1px solid #7e99c6" id="frameBox">
           <iframe id="frameWin" src="01.html" name="opWin" style="100%; height:100% " frameborder="0" scrolling="no" onload="test2()"></iframe>
    </div>


    js脚本(加在主页面):
    function test2(){
           var frameWin = document.getElementById("frameWin");
           var frameBox = document.getElementById("frameBox");
           var newHeight;
           if (frameWin.Document){
                  newHeight = frameWin.Document.body.scrollHeight + 20 + "px";
           }else{
                  newHeight = frameWin.contentDocument.body.scrollHeight+ 20 + "px";
           }
           frameWin.style.height = newHeight;
           frameBox.style.height = newHeight;
    }

    /Files/00fairy00/091228_iframe自适应.rar 

  • 相关阅读:
    file
    shell脚本的执行
    添加源,删除源
    lsattr, chattr
    umask
    od
    init
    sync
    wc
    history
  • 原文地址:https://www.cnblogs.com/tangself/p/1675922.html
Copyright © 2011-2022 走看看