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);
}

<input type="button" value="点击" οnclick="showNew()">

转载于:
https://www.cnblogs.com/feng12345/p/5324389.html
https://blog.csdn.net/weixin_33739627/article/details/93433089

posted @ 2020-07-20 17:49  Cloverlove  阅读(175)  评论(0编辑  收藏  举报