现在的位置: 首页 > 综合 > 正文

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

2012年03月23日 ⁄ 综合 ⁄ 共 615字 ⁄ 字号 评论关闭
使用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>

抱歉!评论已关闭.