zoukankan      html  css  js  c++  java
  • js控制iframe自适应高

    ===========================index.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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head>
    <script type="text/javascript" language="javascript">
    function iFrameHeight() {
        var ifm= document.getElementById("iframepage");
        var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;
        if(ifm != null && subWeb != null) {
            ifm.height = subWeb.body.scrollHeight;
        }
    }
    </script>
    <body>
    aaaaaaaaaaaaaaa
    <iframe onLoad="iFrameHeight()" src="iframe.html" id="iframepage"  frameBorder="1" scrolling="no" width="100%" >
    </iframe>
    bbbbbbbbbbbbbb
    </body>
    </html>

    ===========================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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head>
    <body style="padding:0; margin:0;">
    1111111111
    <div style="border:#00FFFF thin solid; 300px; height:300px; background:#CCCC99"></div>
    2222222222
    </body>
    </html>
  • 相关阅读:
    hiveserver2 with kerberos authentication
    python Basic usage
    python Quicksort demo
    Python HeapSort
    mrunit for wordcount demo
    CCDH证书
    Hadoop question list
    Hadoop Yarn core concepts
    Hadoop Resource
    Hadoop could not find or load main class
  • 原文地址:https://www.cnblogs.com/fonyer/p/2814368.html
Copyright © 2011-2022 走看看