假设主页面有一个div,里面放置一个iframe
3个菜单链接,分别在iframe加载 1.html、2.html、3.html 三个页面。
3个子页面分别在自己页面加载完window.onload执行
function aa(){
var newHeight = document.body.scrollHeight + 20 + "px";
window.parent.document.getElementById("frameBox").style.height = newHeight;
//以上firefox通过,但是ie6必须加上下面这句,不然iframe高度是改了,但是可见区域没有改
window.parent.document.getElementById("frameWin").style.height = newHeight;
}
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29753604/viewspace-1262262/
,如需转载,请注明出处,否则将追究法律责任。