2014-11-14 113 views
0

代码:window.open不同大小的IE和FF

win3 = window.open("Pages/Login.php", "newwindow", "width=316, height=468"); 
win3.moveTo(screen.width/2 - 300, screen.height/2 - 250); 

结果:

enter image description here

为什么有不同的大小?

+0

请注意,您只需在该链接的图片中张贴您的网址。确保你想让互联网知道该网址。 – 2014-11-14 13:51:12

+0

也许body或html标签在你的Login.php上有一个默认的边距或者什么(CSS) 你能显示你的css为那个页面吗? – progsource 2014-11-14 13:52:21

+0

JSK NS:Ty,我删除了URL。 progsource:我正在使用CSS重置。 – Yoshimitso 2014-11-14 14:47:40

回答

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

泰的帮助!

0

从MDN为strWindowFeaturesThe 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); 

应该没问题?

+0

它没有做任何事情,结果相同。 – Yoshimitso 2014-11-14 14:46:53