zl程序教程

您现在的位置是:首页 >  其它

当前栏目

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

通过 页面 调整 高度 iframe 指向
2023-06-13 09:13:42 时间
通过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>