代码如下:
[code]
function reinitIframe(){
var iframe = document.getElementById("frame_content");
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height = parseInt(dHeight)-140;
}
catch (ex){}
}
window.setInterval("reinitIframe()", 200);
[/code]
js实现iframe高度自适应



