Window resize - cross browser

Hi, I am looking for a way to accurately resize the browser to display exactly a 800x600 webpage, with no surrounding white space around on all major browsers.  Possible?  I have tried js window.resizeTo(810,772) which seems to work on FF but has a different result in IE.

Look forward to hearing from you.
TrederAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Göran AnderssonCommented:
Just so you know: many browsers nowadays has resizing of the window disallowed by default.

If you specify a size when you use window.open, that size is the size of the working area.

If you want to use window.resizeTo, you have to calculate the difference between the window size and the workarea size. Resize the window to something that is close to what you want, then use document.partentNode.clientWidth and .clientHeight to find out the size of the working area. Calcualte the difference between the size that you specified and the size that you got, and call resizeTo again with the adjusted values.
0
Göran AnderssonCommented:
Correction: That is document.body.parentNode.clientWidth.
0
TrederAuthor Commented:
Thanks for the reply.  I am no programmer, is there any working code out there for this?  I have explored many a google on it, but have not come across anything that looks to work.  
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Göran AnderssonCommented:
You don't have to be much of a programmer to write the code from my description above. :)

Try this out. I am not 100% certain that it works to resize twice without returning control to the browser inbetween, though.
var w = 800;
var h = 600;
window.resizeTo(w, h);
var w2 = document.body.parentNode.clientWidth;
var h2 = document.body.parentNode.clientHeight;
var dw = w - w2;
var dh = h - h2;
window.resizeTo(w + dw, h + dh);

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
anandhariharanCommented:
This code across browsers. Quite similar to GreenGhost's comment.
var w = 810;
var h = 772;
window.resizeTo(w,h);
function winResize(){
  window.resizeTo(w,h);
}
 
<body onload="winResize()">

Open in new window

0
Göran AnderssonCommented:
anandhariharan, that code assumes a specific difference between the browser window size and the workarea size. That only works for someone who has the exact same combination of operating system, system version, desktop theme, browser and browser toolbar settings as you have...
0
anandhariharanCommented:
GreenGhost, I have just given the size mentioned by the author who posted this query. It can always be changed according to what the author wants. To be very specific for a 800x600 resolution, the width of the browser should be 777px.

The Author can also mention "window.screen.width" if the design is fluid.

Treder, What say?
0
Göran AnderssonCommented:
> GreenGhost, I have just given the size mentioned by the author who posted this query.

Obviously you didn't understand the question, as all you did was to post some code that does exactly the same thing as the code Treder already posted in the question.

> It can always be changed according to what the author wants.

The point is that it can't.
0
Göran AnderssonCommented:
Checking back to see if you had any progress?
0
Computer101Commented:
Forced accept.

Computer101
Community Support Moderator
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.