473,382 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Determine the current window height/width?

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.

Jul 23 '05 #1
5 6452
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 ;)

Jul 23 '05 #2
DU
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 :)
Jul 23 '05 #3
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
Jul 23 '05 #4
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.

Jul 23 '05 #5
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.

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jiri Brada | last post by:
Hi, I have got a following problem with using Javascript: I have a HTML page with pictures' thumbnails. After clicking on any thumbnail, I would like to open a new window with the original...
1
by: stellabein | last post by:
Hi friends, I am very very new to programing. i have a one main window from that window i am opening one modal window using showmodaldialog(m.jp...). in that modal window i have a form. when i...
3
by: Kamyk | last post by:
Hello all! I would like to open a new window with a picture after clicking on a shrinked picture which is located on the main page. I want this new window to be exactly sized as original...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
5
by: Den | last post by:
Hi, I have one simple question: Code: ------------ <html> <body> <input type="button" onclick="openWindow('http://www.google.com', 'Google')" value="Google"> </body> <script...
9
by: Adam | last post by:
Can someone please help!! I am trying to figure out what a font is? Assume I am working with a fixed font say Courier 10 point font Question 1: What does this mean 10 point font Question 2:...
4
by: Perl Beginner | last post by:
I have created a GUI window using Perl Win32::XMLBuilder. This window has several buttons on it, that when a button is clicked another Perl script will execute. When the script is complete, the GUI...
2
by: wreed06 | last post by:
Hello, I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully...
9
dmjpro
by: dmjpro | last post by:
Suppose i have a HTML file like this.... <frameset rows="10%,*"> <frame name="frame1" src="page1"/> <frame name="frame2" src="page2"/> </frameset> Now my page1 is like this ..
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.