Get the Height of Available Window Space with Javascript

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved
Reply

Join Date: Sep 2008
Posts: 173
Reputation: FlashCreations is an unknown quantity at this point 
Solved Threads: 13
FlashCreations's Avatar
FlashCreations FlashCreations is offline Offline
Junior Poster

Get the Height of Available Window Space with Javascript

 
0
  #1
Jul 2nd, 2009
Hi,
I've been designing a web application that scales to fit the available window space in the web browser so that there is no need to use the scroll bar (and the whole point of the application is to fit the window). I've already figured out how to catch resizes and change the height of the elements on the page (It's pretty simple using onload, onresize and document.getElementById().style.height), but I can't seem to get an accurate height to scale the web content with. The height I want is not the height of the document (Which would be the height of the content...which is what I'm trying to change in the first place!) and not the height of the window (Because if I'm not mistaken that includes the status bar, the tab bar, the URL bar, etc. which can vary between browsers). I need the height of the available web space that I can fit my content into. This would be the space between below the tab bar and above the status bar (To make my height as clear as possible I've provided a link to a screenshot). How can I get this height with Javascript (And I really need it to be cross-browser because I want this app to be able to work on multiple browsers)?
Thanks,
FlashCreations

Screenshot (For some reason the DaniWeb Attachment System just refuses to upload my image and gives me a blank page each time I upload the screenshot so I'll just upload it to an image host): http://img15.imageshack.us/img15/4186/screenshothyb.jpg
Last edited by FlashCreations; Jul 2nd, 2009 at 3:07 am.
FlashCreations
(aka PhpMyCoder)

About Me | My Blog | Contact Me
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 66
Reputation: PsychicTide is an unknown quantity at this point 
Solved Threads: 7
PsychicTide's Avatar
PsychicTide PsychicTide is offline Offline
Junior Poster in Training

Re: Get the Height of Available Window Space with Javascript

 
0
  #2
Jul 2nd, 2009
Last edited by PsychicTide; Jul 2nd, 2009 at 9:34 pm.
The only hope is to help and not hinder...
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 173
Reputation: FlashCreations is an unknown quantity at this point 
Solved Threads: 13
FlashCreations's Avatar
FlashCreations FlashCreations is offline Offline
Junior Poster

Re: Get the Height of Available Window Space with Javascript

 
0
  #3
Jul 2nd, 2009
That works perfectly!! Thanks so much!!
FlashCreations
(aka PhpMyCoder)

About Me | My Blog | Contact Me
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC