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内嵌框架如下:

posted @ 2016-05-04 13:44  cglworkBook  阅读(320)  评论(0编辑  收藏  举报