?
Solved

IE browser window size

Posted on 2003-02-21
11
Medium Priority
?
311 Views
Last Modified: 2012-06-27
Okay, so there are many tutorials on adjusting the browser window size with javascript but none of them address the following issue.  

In IE, the self.resizeTo(X,Y) function sets the outside dimension of the browser window.

document.body.clientWidth gives the internal window size without the scroll bar.

document.body.offsetWidth gives the external window size with the scroll bar

(document.documentElement for IE 6)

BUT and here is the issue, neither of them give the window size WITH the "history picker" or "search sidebar" if they are on in the window.  So I'm stuck trying to figure out how to actually make my page display correctly (designed for 800x600 760x420 useable) using offsetWidth with resizeTO.  Or any other method for that matter if the client is using IE with their history/search sidebar open.

Thanks in advance for your help.
-Thorir
0
Comment
Question by:thorir
  • 6
  • 4
11 Comments
 
LVL 63

Expert Comment

by:Zvonko
ID: 7994035
So you ask for the full screen size?

Here it is:
alert(screen.availWidth+" X "+screen.availHeight)


0
 
LVL 63

Expert Comment

by:Zvonko
ID: 7994072
Oh, here your line:

self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);



0
 

Author Comment

by:thorir
ID: 7994084
No, I have the full screen size, that isn't the problem.  I'm looking to resize or calculate the USEABLE browser window size not the entire browser window.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:thorir
ID: 7994093
Hmm, apparently I'm not making myself real clear.  I'm not trying to maximize the window.  Just make it big enough to display the page correctly if they have the search or history sidebar open.
0
 
LVL 63

Accepted Solution

by:
Zvonko earned 330 total points
ID: 7994261
Bigger then maximized is not possible, so what dimensions are you asking for?

Are you asking for displaying minimized to a particular content size?

0
 

Author Comment

by:thorir
ID: 7994334
Yeah, minimized to the content size of 760x420, but if I resizeto that and they have their search sidebar open, I'll loose 100pixels of the width and the page won't look right.  With netscape/mozilla/opera it is easy I just do:

if( window.innerWidth < 760)
window.innerWidth = 760;
if( window.innerHeight < 420)
window.innerHeight = 420;
0
 
LVL 4

Expert Comment

by:whammy
ID: 7996452
You would still use Zvonko's suggestion, but check for IE...

If it's IE, you use screen.availWidth and screen.availHeight... otherwise, use the good stuff.

I hate proprietary implementations... JScript should go bye bye IMHO.
0
 

Author Comment

by:thorir
ID: 8009155
I still haven't resolved this.  Anyone?

I'm not trying to maximize the window.

I'm trying to minimize it without affecting the apperance of my content if someone has an IE search/history bar open in their browser.

Any help would be breatly appreciated.
0
 

Author Comment

by:thorir
ID: 8011763
Well, this is how I resolved this issue:

Here's one method to calculate the outer dimensions of the browser
window in IE. The basic steps are:

  1. Save the current inner dimensions.
  2. Resize the window using fixed values.
  3. Subtract the new inner dimensions from those fixed values. This
     difference is the amount of "chrome" horizontally and vertically.
     Save these values in global variables.
  4. Restore the window to its original size by adding the "chrome"
     values to the saved inner dimensions.

Any way I can give myself back my points?
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 9149959
0
 

Author Comment

by:thorir
ID: 9150016
Yeah, well, I appreciated your attempt to help :).

-Jon
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question