通过ifame指向的页面高度调整iframe的高度

网络编程 发布日期:2026/1/19 浏览次数:1

正在浏览:通过ifame指向的页面高度调整iframe的高度
通过ifame指向的页面高度调整iframe的高度
1.htm的代码:  
<iframe  src=2.htm  id=ifrm></iframe>  

2.htm的代码:   
<script>  
function  resize()  
{parent.document.all.ifrm.height=document.body.scrollHeight;
parent.document.all.ifrm.width=document.body.scrollWidth;
}  
</script>
<body  onload="resize()">  
</body>