如题在页面载入时如果设置某个层ID="DIV1"的宽度比如 1024*768  就是设成 800*600

解决方案 »

  1.   

    我觉得还是根据浏览器窗口宽度来设置好些,有些人显示器大,但浏览器窗口可能不是全屏的屏幕分辨率的高:window.screen.height;
    屏幕分辨率的宽:window.screen.width;
    网页可见区域宽: document.body.clientWidth;
    网页可见区域高: document.body.clientHeight;
      

  2.   


    <script   language=javascript>   
      function  winheightwidthset()   
      {   
        
        var aa=document.getElementById("divgridview");
        aa.style.height=window.screen.height-420;
        aa.style.width=window.screen.width-210;
        
        form1.winHeight1.value = window.screen.height-420;   
        form1.winWidth1.value = window.screen.width-210;
        
      }  
    </script>