window.open 弹出新窗口

1、可重复打开多个
2、桌面居中打开
$('#openPage').click(function () {
    var windurl = location.href + "&Popup=true";
    var pageName = "poppanel" + eval(parseInt(10000 * Math.random()));

    var iWidth = 800; //弹出窗口的宽度
    var iHeight = 600;     //弹出窗口的高度;
    var iTop = (window.screen.availHeight - 30 - iHeight) / 2;     //获得窗口的垂直位置;
    var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;     //获得窗口的水平位置;

    window.open(windurl, pageName, "height=" + iHeight + ", width=" + iWidth + ", top=" + iTop + ", left= " + iLeft + ",location=no,toolbar=no, menubar=no, scrollbars=no, status=no, resizable=yes", false);
});
posted on 2013-05-28 10:34  一路前行  阅读(847)  评论(0编辑  收藏  举报