61,112
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<iframe id=foo src="frameset.htm"></iframe>
</body>
</html>
<frameset rows="100,*,100">
<frame src="top.htm">
<frame src="middle.htm">
<frame src="bottom.htm">
</frameset>
<script>
function setHeight()
{
h = Math.max(document.documentElement.offsetHeight,document.body.offsetHeight)
window.parent.parent.document.getElementById("foo").style.height = 100+h+100 + 50+"px"; //为了保证效果,多加50
}
</script>
<style>
html,body{margin:0;padding:0}
</style>
<body onload="setHeight()">
foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>