Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find IE full Browser Window Height And Width (JavaScript)

Status
Not open for further replies.

fly231

Programmer
May 29, 2005
24
GB
Hi,

I would greatly appreciate if someone could help me with this.

Is there any way of getting the full width and height of an EI browser window using JavaScript.

IE doesn't return the full Browser width, it only returns the inner display area width and height.

What I need it the Full height and width including the toolbars and scrollbars.

Thanks


For FireFox I use
myWidth = window.innerWidth;
myHeight = window.innerHeight;

For IE
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;

 
The easy way would be to get the available dimensions of the screen (screen.availWidth, screen.availHeight), set the window size to that, with the knowledge that the browser will go only as big as that, not more (certainly on XP with only one monitor, anyway).

Then get the innerWidth + height, subtract them from the availWidth + height, and you have an immediate delta for the toolbar & furniture width & height that you can add to any innerWidth & height to find the exact outer dimensions of the browser.

Simple :)

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks for the reply Dan.

I thought of the same thing but my problem is the user shouldn't see the window moving.

What I'm trying to achieve here is when I click a button in the web page it will open up a popup (FAQ section)
Then resize the Opener and dock the popup just next to the Opener with the same height.
This popup won't have anytoolbars turned on.

And also resize the popup or the opener window according to the user drag.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top