根据内容自动高速页面中帧的高度

来源:互联网 发布:汉诺塔递归算法代码 编辑:程序博客网 时间:2024/05/17 02:14

iframe:
<iframe id="oIfrm" src="open.htm" onload="_resize()" width="320"></iframe>


function _resize(){
  var o=document.frames("oIfrm").document.body;
  document.all.oIfrm.style.pixelHeight= o.scrollHeight + 20;
  
      }

-------------------------------------------------------------------------------------------------------------------------


frame:

<script language=javascript>
function _resize(){
 oFrm.rows=document.frames("top").document.body.scrollHeight + ",*";
 alert(document.frames("top").document.body.scrollHeight);
}
</script>
</head>
<frameset cols=100,*>
 <frame src=about:blank>
  <frameset id="oFrm" rows="100,*">
   <frame name=top id=top src=frame1.asp onload="_resize()">
   <frame name=main src=frame2.htm>
  </frameset>
 <frame src=frame1.asp>
</frameset>

原创粉丝点击