window.open different size in IE&FF

65 Views Asked by At

Code:

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

Result:

enter image description here

Why have different size ?

2

There are 2 best solutions below

0
On BEST ANSWER

I'm fix it with resizeTo() function.

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 for help!

1
On

From MDN for strWindowFeatures: The string must not contain any whitespace, and each feature name and its value must be separated by a comma

So,

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

should be okay?