Link to home
Start Free TrialLog in
Avatar of prosoftsolutionsinc
prosoftsolutionsinc

asked on

HTML Window Resize in <Body> tag?

This one should be simple, but I just can't find the answer.  How do you size the browser Window in both Netscape and IE, or are there different tags for each browser?  I believe this is an attribute of the <Body> tag, is it not?
ASKER CERTIFIED SOLUTION
Avatar of b1xml2
b1xml2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
//window.resizeBy(<width>,<height>);
window.resizeBy(300,-100);

resizing browsers thru the window object, nothing to do with the body tag.
the code is cross-browser =)
window.resizeTo is an absolute method
window.resizeBy is a relative method
Brandon, I think perhaps what the questioner was getting at is that if someone was using a script like you posted, it migth be called on the "onLoad" event of the body tag, correct?


<html>
<head>

<script language="javascript">
function resize()
{
//window.resizeTo(<width>,<height>);
window.resizeTo(400,500);
}
</script>

</head>

<body onLoad="resize();">

</body>
</html>

the methods do not need to be called after the body is loaded. the methods can be called at any point in time.

<html>
<head>

<script language="javascript">

//window.resizeTo(<width>,<height>);
window.resizeTo(400,500);

</script>

</head>

<body>

</body>
</html>
Avatar of DreamMaster
DreamMaster

It's not an attribute of the body tag, but offcourse you can call it from the body tag...

You don't need to use a different function to do it either...

You could just use:

<body onload="window.resizeTo(400,500)">

Mind the capital T...

Max.
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

Cd&

It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to b1xml2

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
Thanks, Cd&, for your help here.

This has been finalized today, and monitoring for comments.

Moondancer - EE Moderator