如何讓我的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