Js部分
function SetWinHeight(obj) { var win = obj; if (document.getElementById) { if (win && !window.opera) { if (win.contentDocument && win.contentDocument.body.offsetHeight) win.height = win.contentDocument.body.offsetHeight; else if (win.Document && win.Document.body.scrollHeight) win.height = win.Document.body.scrollHeight; } } }
调用(注意onload方法)
<iframe onload="SetWinHeight(this)" height="1050" frameborder="0" src="main.aspx" width="100%"></iframe>