使用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>

你可能感兴趣的:(jquery)