window.open窗口显示在屏幕中央

function showNew()
{
var width=200;
    var height=200;
var y=(window.screen.availHeight-200);
var x=(window.screen.availWidth-200);
var mywindow=window.open("","_blank","height="+height+",width="+width);
mywindow.moveTo(x/2,y/2);
}
</script>
<input type="button" value="点击" onclick="showNew()">
posted @ 2016-03-26 22:49  夜深人静123  阅读(724)  评论(0编辑  收藏  举报