61,112
社区成员
发帖
与我相关
我的任务
分享
<script language="javascript">
function changeFrameHeight()
{
document.getElementById("ConFrame").height = document.body.clientHeight - 166;
}
</script>
</head>
<body onload="changeFrameHeight();" onresize="changeFrameHeight();">
<div class="layout">
<ul>
<li class="header"> </li>
</ul>
<ul>
<li class="iframe"> <iframe id="ConFrame" src="http://www.163.com" frameborder="0" width="100%" height="100%"> </iframe> </li>
</ul>
<ul>
<li class="footer"> </li>
</ul>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档 </title>
<style type="text/css">
body,html{margin:0;height:100%;overflow:hidden;font-size:12px;}
li,ul{list-style:none;margin:0;padding:0;}
.layout{width:100%;height:100%;}
.layout li{width:100%;}
.layout li.header{height:150px;background-color:#342959;}
.layout li.iframe{height:100%;}
.layout li.footer{height:16px;background-color:#181330;position: absolute; bottom: 0; left: 0;}
</style>
</head>
<script>
function aa(){
//加上这句IE里解决效果更好
document.getElementById("divIframe").style.height=document.body.offsetHeight-150-16;
}
</script>
<body onload="aa();">
<div class="layout">
<ul>
<li class="header"> </li>
<li class="iframe" id=divIframe>
<iframe id="Iframe" src="http://lastidea.net" frameborder="0" width="100%" height="100%" onload="this.height=document.body.offsetHeight-150-16;"> </iframe> <!-兼容FF,但是要等到框架页加载完成后才有效果~--></li>
<li class="footer"> </li>
</ul>
</div>
</body>
</html>