使用jquery来使ID为tdMain的DIV的高度自动适应窗口高度

使用jquery来使ID为tdMain的DIV的高度自动适应窗口高度
<script language="javascript" type="text/javascript" src="script/jquery.js"></script>
<script type="text/javascript" language="javascript">
  
var h = (window.innerHeight || (window.document.documentElement.clientHeight || window.document.body.clientHeight));
  $(
"#tdMain").css({"height":h-86});
  $(
"#left").css({"height":h-96});
  
  window.onresize 
= resize;
  
function resize(){
    
var h = (window.innerHeight || (window.document.documentElement.clientHeight || window.document.body.clientHeight));
    $(
"#tdMain").css({"height":h-86});
    $(
"#left").css({"height":h-96});
  }
</script>
posted @ 2008-12-03 08:38  angushine  阅读(1306)  评论(3编辑  收藏  举报