当前位置: 代码迷 >> JavaScript >> js打开新窗口设立窗口大小
  详细解决方案

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

热度:188   发布时间:2012-10-17 10:25:47.0
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();
}

  相关解决方案