iframe内嵌框架自适应高度

添加js代码:

/iframe内嵌框架自适应高度/
function iFrameHeight() {
var ifm= document.getElementById("iframepage");
var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;
if(ifm != null && subWeb != null) {
ifm.height = subWeb.body.scrollHeight;
}
}

在html页面添加iframe内嵌框架如下:

原文地址:https://www.cnblogs.com/cglWorkBook/p/5458134.html