调整窗口大小

function window.onload()//调整窗口大小dialogWidth:590px; dialogHeight:1px; scroll:auto; center:yes; help:no; resizable:no; status:no;
{
var w,h;
var agent = navigator.userAgent;
w = Form1.scrollWidth+6;
if(agent.lastIndexOf("Windows NT 5.1")!=-1)//w2k:5.0,wxp:5.1,w2003:5.2
{
h = Form1.scrollHeight + 32;
}
else
{
h = Form1.scrollHeight + 26;
}
if(h>screen.availHeight)
{
h=screen.availHeight;
}
window.dialogWidth = w + "px";
window.dialogHeight = h + "px";
window.dialogLeft = (screen.availWidth - w) / 2;
window.dialogTop = (screen.availHeight - h) / 2;
}

你可能感兴趣的:(windows)