zoukankan      html  css  js  c++  java
  • iframe动态改变内嵌页面高度

    test.html

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <title> New Document </title>
      <meta name="Generator" content="EditPlus">
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
     </head>
    
    
     <body>
    <table align=center cellspacing=0 cellpadding=0 height="100%" border=0>
    <tbody>
    <tr>
    <td valign="top" width="206" name="frametitle" id="frametitle">
    <iframe style="z-index: 1; visibility: inherit;  206px;height:100%" name="leftmenu" id="leftmenu" src="nest.html" frameborder=0  scrolling="no"></iframe>
    </td>
    </tr>
    </tbody>
    </table>
     </body>
    </html>
     <script type="text/javascript">
    function TuneHeight(){
    	var h = document.getElementById("leftmenu").contentWindow.document.body.scrollHeight + "px";
    		document.getElementById("frametitle").style.height=h;
    	}
    	window.onload=TuneHeight;
    </script>
    

    nest.html

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <title> New Document </title>
      <meta name="Generator" content="EditPlus">
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
       <script type="text/javascript">
       function test(){
    	document.write("<span>----------------------------------</span>");
    	window.parent.TuneHeight();
       }
       setInterval(test,1000);
    	
      </script>
     </head>
    
     <body>
      
     </body>
    </html>
    


  • 相关阅读:
    echarts3.0 实例容器不实时更新页面的问题
    Mac下搭建atx2环境
    MAC 下SFT环境搭建及使用
    【转发】基本adbui命令使用 可做图像识别
    UIAutomator2的API文档(三)
    UIAutomator2的API文档(二)
    UIAutomator2的API文档(一)
    UIAutomator2安装及连接
    uiautomator2通过wifi操作手机
    ATX-UI自动化环境搭建
  • 原文地址:https://www.cnblogs.com/bhlsheji/p/5378470.html
Copyright © 2011-2022 走看看