您的位置:首页 > Web前端 > JavaScript

Javascript window.open让窗口居中的代码

2011-03-20 14:04 411 查看
function OpenEnvDefineWin()
{
var width = 400;
var height = 300;
var left = eval(screen.width - width) / 2;
var top = eval(screen.height - height) / 2;
var open_feature = "width=" + width + ", height=" + height + ", left=" + left + ", top=" + top + ", scrollbar=no";
var hwnd = window.open("popup.html", "_blank", open_feature);
if ((window != null) && (!hwnd.opener))
hwnd.opener = window;
hwnd.focus();
return false;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: