JoJo
JoJo

Reputation: 4933

Javascript window.open height will not go as tall as I set, why?

JavaScript window.open height will not go as tall as I set, why?

I am using FF, IE, Chrome, and using this function.

function open_win3(zoom) {
New_Win3 =window.open(zoom,"_blank","width=550,height=1970,scrollbars=0,menubar=0");
}
var zoom = "/zoom.asp"

Will the height of the new window opened by JavaScript only be as tall as the monitor itself is tall?

Chrome also added scroll bars, when clearly scrollbars are negative, but I got around that by using

<style type="text/css">
    body { overflow: hidden; }
</style>

Thanks.

Upvotes: 3

Views: 465

Answers (1)

Denys S&#233;guret
Denys S&#233;guret

Reputation: 382394

From the Mozilla documentation :

Requested position and requested dimension values in the features list will not be honored and will be corrected if any of such requested value does not allow the entire browser window to be rendered within the work area for applications of the user's operating system. No part of the new window can be initially positioned offscreen. This is by default in all Mozilla-based browser releases.

As many other features regarding window.open, this can be easily explained as a security : the browser must prevent the user from not understanding he's looking at a new browser window, or having difficulties closing it.

Upvotes: 3

Related Questions