Size of the window
Moderator: General Moderators
Size of the window
Hello to all,
Can You tell me how to get the width & height of the browsers window. In one book (O'Rielly, "JavaScript", David Flanagan, 2000) I read that Netscape 4 supports some sort of 'outerWidth' & 'outerHeight' but nothing for IE.
Can You tell me how to get the width & height of the browsers window. In one book (O'Rielly, "JavaScript", David Flanagan, 2000) I read that Netscape 4 supports some sort of 'outerWidth' & 'outerHeight' but nothing for IE.
IE has these properties
Konqueror and opera are going to implement most of IE's features (or already have). HTML-DOM 2.0 seems to be a good approach as all of them claim to implement it in newer versions.
opera spec
I've been ignoring Netscape for quite a while since it failed so many of my tests. But as mentioned this was 'long ago', things may have improved. I'll give it a try in the near future (
)
Konqueror and opera are going to implement most of IE's features (or already have). HTML-DOM 2.0 seems to be a good approach as all of them claim to implement it in newer versions.
opera spec
I've been ignoring Netscape for quite a while since it failed so many of my tests. But as mentioned this was 'long ago', things may have improved. I'll give it a try in the near future (
the problem is that you want to receive the browser-width and -height. almost does it for the x-coord. But does not measure the window-title or tools-bars. I found no way to get these values from INSIDE the document (which does not mean, that there is no way
)
Code: Select all
posX = (screen.width - document.body.offsetWidth) / 2;Code: Select all
posY = (screen.height - document.body.offsetHeight) / 2;1. Chill out. I don't tolerate rudeness on these boards, especially from someone who hasn't contributed back. You have been warned. Now, back to being civilized.Stoyanski wrote:I just want to know the damned WindowSize is that so difficult?jason wrote:Trying to find the screen resoltion might be better, as finding the window size won't make it any easier to center it.
2. I hope this helps: http://web-wise-wizard.com/javascript-r ... ation.html I googled for it and like I said, it should do the trick.
sorry, this one fails as well. it only checks for innerWidth

he may be a little bit annoyed since he ICQed me and it took a while 'til I got the point1. Chill out. I don't tolerate rudeness on these boards, especially from someone who hasn't contributed back. You have been warned. Now, back to being civilized.
I think the 'innerWidth' will do the job.
PS:
That was a bad start for me in this forum, but I will do my best.
PS:
That was a bad start for me in this forum, but I will do my best.
Last edited by Stoyanski on Mon Jun 03, 2002 4:54 pm, edited 1 time in total.