iframe自适应高度(IE6、IE7、fireFox下测试通过 必须统一域下)

iframe自适应高度(IE6、IE7、fireFox下测试通过)
2007-11-09 14:14

<script type="text/javascript" language="javascript">  
<!--  
//调整 PageContent 的高度  
function TuneHeight() {  
var frm = document.getElementById("content01");  
var subWeb = document.frames ? document.frames["content01"].document : frm.contentDocument;  
if(frm != null && subWeb != null) {
   frm.height = subWeb.body.scrollHeight;
}  
}  
//-->  
</script>

<iframe id="content01" name="content01" frameBorder=0 scrolling=no src="main.html" width="100%"onLoad="TuneHeight()" ></iframe>

posted on 2009-09-08 15:59  banditi  阅读(1330)  评论(0编辑  收藏  举报