window.onresize=function(){
  document.getElementById("Main").style.width=(document.body.screenWidth>950)?"100%":"950px";
  document.getElementById("Main").style.height=(document.body.screenHeight>620)?"100%":"620px";

解决方案 »

  1.   

    width就没事,height就怎么弄都不行,真慌了,帮帮忙T.T;
    IE倒是都没问题,就是非IE不行...
      

  2.   

    做了个input测试
    document.body.scrollHeight>600 倒是能正确输出了true和false
    就是document.getElementById("Main").style.height一直输出100%...
      

  3.   

    if (document.body.scrollHeight>620)
    我觉得你这个是关键
      

  4.   

    可是....能正确输出true和false...
      

  5.   

    if(document.body.scrollHeight>620)
    ===>>>
    if(parseInt((document.body.scrollHeight+"").replace("px",""))>620)
      

  6.   

    找到问题了...
    因为我object下面还有一个table。height是26
    得>626...
      

  7.   

    window.onresize=function(){
      document.getElementById("Main").style.width=(document.body.clientWidth<750)?"100%":"750px";
      document.getElementById("Main").style.height=(document.body.clientHeight<620)?"100%":"620px";
      

  8.   

    要的是这个效果吧?测试过在ie7和ff3都可以