日期:2014-05-16  浏览次数:20430 次

js打开新窗口设置窗口大小

javascript:g_OpenWindow(url.jsp,? '800','600');

?

function g_OpenWindow(pageURL, innerWidth, innerHeight)
{
?var ScreenWidth = screen.availWidth
?var ScreenHeight = screen.availHeight
?var StartX = (ScreenWidth - innerWidth) / 2
?var StartY = (ScreenHeight - innerHeight) / 2
?wins = window.open(pageURL, 'OpenWin', 'left='+ StartX + ', top='+ StartY + ', Width=' + innerWidth +', height=' + innerHeight + ', resizable=no, scrollbars=yes, status=no, toolbar=no, menubar=no, location=no')
?wins.focus();
}