PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Sep 21, 2018 6:39 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Size of the window
PostPosted: Mon Jun 03, 2002 1:52 pm 
Offline
Forum Newbie

Joined: Sun Jun 02, 2002 9:33 am
Posts: 15
Location: BG
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 03, 2002 2:15 pm 
Offline
DevNet Evangelist
User avatar

Joined: Tue May 07, 2002 9:48 am
Posts: 8391
Location: Berlin, ger
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 ( ;) )


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 03, 2002 2:41 pm 
Offline
Forum Newbie

Joined: Sun Jun 02, 2002 9:33 am
Posts: 15
Location: BG
I'm trying to get (find out) the size of the WINDOW not DOCUMENT. The script actually resizes the window [javascript:resizeTo(w,h);] and to center it [javascript:moveTo(w,h);] I need to know EXACT width & height to do this.
Got it?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 03, 2002 2:50 pm 
Offline
Site Admin

Joined: Thu Apr 18, 2002 3:14 pm
Posts: 1767
Location: Montreal, CA
Trying to find the screen resoltion might be better, as finding the window size won't make it any easier to center it.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 03, 2002 3:20 pm 
Offline
Forum Newbie

Joined: Sun Jun 02, 2002 9:33 am
Posts: 15
Location: BG
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.


I just want to know the damned WindowSize is that so difficult?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 03, 2002 3:38 pm 
Offline
DevNet Evangelist
User avatar

Joined: Tue May 07, 2002 9:48 am
Posts: 8391
Location: Berlin, ger
the problem is that you want to receive the browser-width and -height.
Syntax: [ Download ] [ Hide ]
posX = (screen.width - document.body.offsetWidth) / 2;
almost does it for the x-coord. But
Syntax: [ Download ] [ Hide ]
posY = (screen.height - document.body.offsetHeight) / 2;
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 ;) )


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 03, 2002 4:11 pm 
Offline
Site Admin

Joined: Thu Apr 18, 2002 3:14 pm
Posts: 1767
Location: Montreal, CA
Stoyanski wrote:
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.


I just want to know the damned WindowSize is that so difficult?


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.

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. :D


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 03, 2002 4:18 pm 
Offline
DevNet Evangelist
User avatar

Joined: Tue May 07, 2002 9:48 am
Posts: 8391
Location: Berlin, ger
sorry, this one fails as well. it only checks for innerWidth
Quote:
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.
he may be a little bit annoyed since he ICQed me and it took a while 'til I got the point ;)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 03, 2002 4:49 pm 
Offline
Forum Newbie

Joined: Sun Jun 02, 2002 9:33 am
Posts: 15
Location: BG
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.


Last edited by Stoyanski on Mon Jun 03, 2002 4:54 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 03, 2002 4:51 pm 
Offline
Site Admin

Joined: Thu Apr 18, 2002 3:14 pm
Posts: 1767
Location: Montreal, CA
It's all good. We are forgiving here. Hey, people come in, they make a mistake, you point it out, and it's over. I would just rather tackle things early and risk a broken ego or two than not say anything.

:D

No hard feelings of course. 8)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group