我们在另一台服务器上托管了一个页面,当用户登录到我们的应用程序时,他们可以通过单击按钮导航到该外部页面。
在 Google chrome 中左下角打开的页面没有任何问题,但是当我们在 IE 中尝试时,窗口正在打开,但页面就像进入屏幕一样。
代码:
myWindow = window.open("mysite.com",
'',
'resizable=no, scrollbars=yes, status=yes, width=' + 1500 / systemZoom +
', height=' + 500 / systemZoom +
', top=' + top +
', left=' + left);
最佳答案
尝试使用以下代码显示弹窗:
<script type="text/javascript">
function popupwindow(url, title, w, h) {
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
</script>
<a href="javascript:popupwindow('https://www.google.com','google','900','500'); ">This is the link</a>
关于javascript - IE 中的 window.open 对齐问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57359694/