2014-11-14 34 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