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

怎样通过ifame指向的页面高度调整iframe的高度,这样可以避免iframe的滚动条
---------------------------------------------------------------

 1<iframe id="frm" name="ifrm" src="yourPage.asp"><iframe>
 2<button onclick="frm.style.height=document.ifrm.document.body.clientHeight">   
 3让iframe高度适应其内叶面高度</button>   
 4  
 5\---------------------------------------------------------------   
 6  
 71.htm的代码:   
 8<iframe id="ifrm" src="2.htm"></iframe>   
 9  
102.htm的代码:   
11<script>   
12function resize()   
13{parent.document.all.ifrm.height=document.body.scrollHeight;}   
14</script>
15<body onload="resize()">
16</body></iframe></iframe>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus