function iFrameHeight() {
/***
* ifram自适应大小
* **/
var ifm= document.getElementById("iframepage");
var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentWindow.document;
if(ifm != null && subWeb != null) {
ifm.height = subWeb.documentElement.scrollHeight;
}
原文:http://blog.csdn.net/shitouswpu/article/details/44977861