<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style>
#pvshow{font-family:Georgia;font-size:11pt;}
</style>
<script src="jquery-1.4.2.min.js"></script>
</head>
<body style="margin:0;padding:0;height:0px">
<div id="top" style="background-color:#009; height:120px; overflow:hidden;"></div>
<div id="left" style="background-color:#C00; width:200px; height:300px; overflow:hidden; display:inline; float:left"></div>
<div id="divMain" style="background-color:#0F0; height:600px;overflow-x:hidden; overflow-y:auto; margin-left:200px!important"></div>
</body>
<!--script language="javascript">
这一段被注掉的内容,是126邮箱中找到的一段,只是实现了内容适应当前大小,再结合下面的方法,应该也挺好用的
function fPosition(oElement) {
var valueT = 0, valueL = 0;
do {
valueT += oElement.offsetTop || 0;
valueL += oElement.offsetLeft || 0;
oElement = oElement.offsetParent;
}
while (oElement);
return [valueL, valueT];
};
var aPos = fPosition(document.getElementById("divMain"));
document.getElementById("divMain").style.height = (self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) - aPos[1] + "px"; </script-->
<script>
$(function(){
window.onresize = adjust;
adjust();
});
var adjust=function(){
var h=document.documentElement.clientHeight;
//var h=document.body.offsetHeight; 有人说是采用这种方法,不过,试过之后,发现不是那么回事,难道我试错了?
$("#left").css("height",h-120);
$("#divMain").css("height",h-120);
}
</script>
</html>