window.open('xxx.asp','view','width=500,height=400,top=50,left=100')

解决方案 »

  1.   

    在javascript 中取屏幕的横长和纵长,然后取1/2,
    该怎么写?
    多谢
      

  2.   

    window.open('xxx.asp','','width='+(screen.width/2)+',height='+(screen.availHeight/2)+',left='+(screen.width/4)+',top='+(screen.availHeight/4)+')
      

  3.   

    修正一下
    window.open('xxx.asp','','width='+(screen.width/2)+',height='+(screen.availHeight/2)+',left='+(screen.width/4)+',top='+(screen.availHeight/4))screen.width    screen.height    屏幕分辨率
    screen.avaliWidth screen.availHeight 屏幕可用宽高,主要是去掉任务栏的高度/宽度
      

  4.   

    function OpenWeb( url, winname, w, h )
    {
    iT = (screen.availHeight-h)/2-15;
    iL = (screen.availWidth-w)/2-3;
    window.open(url, winname, "height="+h+",width="+w+",top="+iT+",left="+iL+",toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no");
    }