mbm29414
mbm29414

Reputation: 11598

JavaScript window.open Correct Size for all browsers

So, basically, I've got a search results screen with an "Open" button for each result. Clicking that button should open a new window with a streamed database BLOB displayed.

I have everything working properly except for the correct sizing of the newly opened window.

Here's the code I'm trying to use:

window.open('View.aspx', 'Document', 'width=' + screen.width + ', height=' + screen.availHeight + ');

This seems to work correctly on IE, but it fails on Chrome. It seems that Chrome is setting the innerHeight, not the outerHeight, but I can't seem to find a good cross-browser way to make this work.

Upvotes: 0

Views: 881

Answers (1)

IvanH
IvanH

Reputation: 5159

You can find the window outer size Getting the width/height of the entire browser in IE? (there is a solution for other browsers too) and correct size of the window with resizeTo() or resizeBy().

Upvotes: 2

Related Questions