原文:http://www.shareme.cn/blog/article.asp?id=332
<script type="text/javascript"> function SetCwinHeight(iframeObj){ if (document.getElementById){ if (iframeObj && !window.opera){ if (iframeObj.contentDocument && iframeObj.contentDocument.body.offsetHeight){ iframeObj.height = iframeObj.contentDocument.body.offsetHeight; }else if(document.frames[iframeObj.name].document && document.frames[iframeObj.name].document.body.scrollHeight){ iframeObj.height = document.frames[iframeObj.name].document.body.scrollHeight; } } } } </script> <iframe width="100%" name="frameContent" οnlοad="SetCwinHeight(this)" frameborder="0" src="*"></iframe>