window.open 打开窗口居中显示

 var iWidth = 650;  //新打开窗口的宽
 var iHeight = 450; //新打开窗口的高
 var vTop = (window.screen.availHeight - 30 - iHeight) / 2;  
 var vLeft = (window.screen.availWidth - 10 - iWidth) / 2;
 window.open(window.location.origin + '/api/common/attachment/forwardFile?fileId=' + fileId, '_blank', 'height=' + iHeight + ',innerHeight=' + iHeight + ', width = ' + iWidth + ', innerWidth = ' + iWidth + ', top = ' + iTop + ', left = ' + iLeft + ', status = no, toolbar = no, menubar = no, location = no, resizable = no, scrollbars = 0, titlebar = no ');
发布了45 篇原创文章 · 获赞 20 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/czp555/article/details/102957284
今日推荐