Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Determine the current window height/width?

Reply
Thread Tools

Determine the current window height/width?

 
 
Dave Hammond
Guest
Posts: n/a
 
      04-15-2005
You'd think this would be a basic part of the window object (and
perhaps it is and I'm just being dense), but I can't find any reference
in the IE window object documentation to a property which returns the
current window height/width. I can't check Mozilla, as the site is
currently unresponsive, but i don't recall there being any mention of
height/width properties in the Mozilla window object docs either.
Seems like if the object can tell me what its current top/left corner
is, then it should be able to tell me what its size is. Am I missing
something?

As for the application, I'd like to be able to resize a window, run a
script, then restore the window to its original size when the script
completes.

Thanks in advance, and if I'm being blind or dense, please be gentle
with the flames.

-Dave H.

 
Reply With Quote
 
 
 
 
Dave Hammond
Guest
Posts: n/a
 
      04-15-2005
Well, I was able to get on mozilla.org and found the innerHeight and
innerWidth properties. A quick test shows they don't work in IE, so
I'm still stuck for a solution and would still appreciate any
recommendations (other than 'switch to Firefox' which is unfortunately
not an option

 
Reply With Quote
 
 
 
 
DU
Guest
Posts: n/a
 
      04-17-2005
Dave Hammond wrote:

> You'd think this would be a basic part of the window object (and
> perhaps it is and I'm just being dense), but I can't find any reference
> in the IE window object documentation to a property which returns the
> current window height/width.


The content area (window viewport) only or the whole window? Anyway,
why would you need to determine the window dimensions of your webpage
visitor?

I can't check Mozilla, as the site is
> currently unresponsive, but i don't recall there being any mention of
> height/width properties in the Mozilla window object docs either.
> Seems like if the object can tell me what its current top/left corner
> is, then it should be able to tell me what its size is. Am I missing
> something?
>
> As for the application, I'd like to be able to resize a window, run a
> script,


What does your script need to do?

then restore the window to its original size when the script
> completes.
>


Most browser users now disable, turn off script abilities to resize and
move windows in a majority of browsers. Why would you need to resize the
browser window back and forth like that to begin with?

> Thanks in advance, and if I'm being blind or dense, please be gentle
> with the flames.
>
> -Dave H.
>


DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.7
 
Reply With Quote
 
Fred Oz
Guest
Posts: n/a
 
      04-17-2005
Dave Hammond wrote:
> You'd think this would be a basic part of the window object (and
> perhaps it is and I'm just being dense), but I can't find any reference
> in the IE window object documentation to a property which returns the
> current window height/width. I can't check Mozilla, as the site is
> currently unresponsive, but i don't recall there being any mention of
> height/width properties in the Mozilla window object docs either.
> Seems like if the object can tell me what its current top/left corner
> is, then it should be able to tell me what its size is. Am I missing
> something?
>
> As for the application, I'd like to be able to resize a window, run a
> script, then restore the window to its original size when the script
> completes.
>
> Thanks in advance, and if I'm being blind or dense, please be gentle
> with the flames.


Please be gentle with browser windows. If this is for an intranet
and there are valid reasons for re-sizing windows, fine. But playing
with a user's windows on the internet is considered rude and
offensive - but if you want to annoy your visitors, that's up to you.

Anyhow, whatever you need to know can probably be found here:

<URL:http://www.quirksmode.org/>

Follow the 'viewport' and "Browser compatibility" links.


>
> -Dave H.
>



--
Fred
 
Reply With Quote
 
Dave Hammond
Guest
Posts: n/a
 
      04-18-2005
Thanks, Fred. It is, in fact, for a private intranet-based application
which opens multiple windows for various components of the application
(menu, main program, messages, etc). My reason for wanting to know the
original window size is so that upon logout from the application,
rather than be rude and leave the user with a resized window, I can
restore their original window dimensions and attributes.

-Dave H.

 
Reply With Quote
 
Dave Hammond
Guest
Posts: n/a
 
      04-18-2005
Hi DU,

As for my reasons for wanting to resize and move windows, please see my
response to Fred Oz. As for your opinion that most browser users now
disable script abilities to resize, I would respectfully disagree. The
vast majority of browser users wouldn't begin to know how to do that.
Sure, those who live and breath the internet know what they're doing,
but those who just use it as a means to an end (information,
entertainment, productivity, etc) still use the IE which came installed
on their PCs, and still consider most of the Tools menu options
(including preferences) to be places better left unexplored. Perhaps
sad, but undeniably true.

-Dave H.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[JSF] How to determine the WEB-INF path of the current web application? Sven Jacobs Java 7 02-19-2006 12:25 AM
close current window using window.close() Shang Wenbin Javascript 10 09-02-2005 12:16 AM
How can I determine the current Url inside a web service? Michael Rodriguez ASP .Net 1 03-02-2005 12:15 AM
nuby: determine method passed and determine the receiver that received the method Peņa, Botp Ruby 1 01-24-2004 07:51 PM
openning window from the current window. Eitan ASP .Net 2 12-13-2003 09:49 PM



Advertisments