道不远人,深入.net底层技术
业精于勤荒于嬉,行成于思毁于随!
 

 

<iframe id="iFrame1" name="iFrame1" width="100%" onload="this.height=iFrame1.document.body.scrollHeight" frameborder="0" src="index.htm"></iframe>

看到了吧,关键就在于onload="this.height=iFrame1.document.body.scrollHeight"! 

 

 

如果写在IFrame内容页中,

Parent.docuemnt.getElementById('父页面的IFrameID').height = document.body.scrollHeight;

 

 

写在 onload  onresize 事件中。

posted on 2008-12-19 17:25  扬帆起航  阅读(357)  评论(0编辑  收藏  举报