如何让我的iframe填满窗口并且不显示任何滚动条?用iFrame填充窗口而不显示滚动条?
这适用于IE6,我想获得它的可能的话所有的浏览器:
<iframe name=iframe1 src="theSiteToShow.html" width="100%" height="100%" frameborder="0" marginheight="10" marginwidth="10"></iframe>
<script type="text/javascript">
function resizeIframe() {
var height = document.documentElement.clientHeight;
height -= document.getElementById('frame').offsetTop;
// not sure how to get this dynamically
height -= 20; /* whatever you set your body bottom margin/padding to be */
document.getElementById('frame').style.height = height +"px";
};
document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe;
</script>
使用'框架集'。 ;) – graphicdivine 2010-02-02 15:54:43