始终在屏幕中间弹出窗口

function OpenWindow(url,width,height,name,options)
{
var left = (screen.width-width)/2;
var top = (screen.height-height)/2;
if(options ==null)
options ="";
var newWin =  window.open(url,name,"left=" +left+",top="+top+",width="+width+",height="+height+","+options);
newWin.focus();
return newWin;

}

原文地址:https://www.cnblogs.com/star250/p/631356.html