473,503 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get the Height of window

6 New Member
Hello All,

How to get the dynamically increasing height of the window using javascript?\

Thank you all,
Apr 17 '08 #1
1 1138
mrhoo
428 Contributor
Here is one way- it adds a global winSize array with two methods.

Calling winSize[0]() returns the window width,
winSize[1]() returns the height.


Expand|Select|Wrap|Line Numbers
  1. (function(){
  2.     if(window.innerWidth){
  3.         winSize=[function(){ return window.innerWidth},
  4.         function(){return window.innerHeight}]
  5.     }
  6.     else{
  7.         var B= document.body;
  8.         var D= document.documentElement;
  9.         D= (D.clientWidth)? D: B;
  10.         winSize=[ function(){return D.clientWidth},
  11.         winHeight= function(){return D.clientHeight}]
  12.     }
  13. })()
Apr 17 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
12171
by: Paul | last post by:
Hi, I'm wondering if someone out there can help me overcome this quandary. I need to be able to calculate the height of the current page. I need to calculate the height of the page in pixels after...
6
3400
by: Jason Bassford | last post by:
Okay, What I'm trying to do is create two boxes, one on top of the other. The first is a static height, the 2nd, underneath it, should take up the remaining amount of screen space and overflow...
5
2895
by: Secret Guy | last post by:
Because of my experience posting various places over the last couple of weeks: I'm expecting to be greated with hostility for asking about concepts instead of "practical" things, since that has...
12
10123
by: Kepler | last post by:
How do you get the height of the client browser in IE? Both document.body.clientHeight and document.body.offsetHeight return the height of the document. If the page is long and there's a vertical...
2
8690
by: Animanera | last post by:
Hi to all. Is there a way that I can obtain the WINDOW INNER HEIGHT via JS (need only for Internet Explorer 6)? But please give attention to the words INNER and WINDOW. In particular, INNER...
1
2329
by: Rune Jacobsen | last post by:
Hi all, I have an application with one particular form that lists a number of items in a listview. In addition to the listview, there is a panel on top with some simple controls to go back and...
4
12498
by: reycri | last post by:
I have a page that works as I intend in IE but not in Firefox: <html> <head> <title>Overflow Test</title> </head> <body style='overflow:hidden; margin:0; padding:0;'> <table border='0'...
1
3581
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading...
2
3982
by: laszlokenez | last post by:
Tested in IE7 and FF2. I have 2 frames, 2 similar tables in them, similar CSS. (I have 1px cellpadding, and 1px border aroud the cells. From one frame I read the offsetHeight of a cell...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.