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

通过ifame指向的页面高度调整iframe的高度
1.htm的代码:
<iframesrc=2.htmid=ifrm></iframe>

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

相关推荐

评论

展开