代码:
win3 = window.open("Pages/Login.php", "newwindow", "width=316, height=468");
win3.moveTo(screen.width / 2 - 300, screen.height / 2 - 250);
结果:
为什么有不同的尺寸?
答案 0 :(得分:0)
来自MDN的strWindowFeatures
:The string must not contain any whitespace, and each feature name and its value must be separated by a comma
所以,
win3 = window.open("Pages/Login.php", "newwindow", "width=316,height=468");
win3.moveTo(screen.width / 2 - 300, screen.height / 2 - 250);
应该没事吗?
答案 1 :(得分:0)
我用resizeTo()函数修复它。
win3 = window.open("Pages/Login.php", "newwindow", "width=316, height=468");
win3.resizeTo(316, 468);
win3.moveTo(screen.width / 2 - 300, screen.height / 2 - 250);
Ty求助!