<html>
<head>
<title>DIV层始终在页面最底部</title>
<script type="text/javascript">
var heighttemp = 400;
function changeHeight()
{
var temp = document.getElementById("tableid");
heighttemp = heighttemp +100;
temp.style.height = heighttemp;
}
</script>
</head>
<body leftmargin="0" topmargin="0">
<table width="100%" height="405" bgcolor="#eeeeee" id="tableid" onclick="changeHeight()">
<tr>
<td>
JS获取网页高度及屏幕分辨率高度让DIV层始终在页面最底部,点击这里增加table高度--点击一次增加100px
</td>
</tr>
</table>
<div id="t1" style="position:absolute;border:double;width=500">
这个是底部div,会一直在网页底部.....
</div>
<script language="javascript">
//document.all.t1.style.top = document.body.clientHeight;
var h1 = window.screen.availHeight-165;
if (document.body.clientHeight<h1)
document.all.t1.style.top = window.screen.availHeight-165;
//document.write ("当前窗口宽:"+document.body.offsetWidth+"; 高:"+document.body.clientHeight+"aaaa"+(window.screen.availHeight));
</script>
</body>
</html>