Solved

HTML Window Resize in <Body> tag?

Posted on 2002-03-17
9
317 Views
Last Modified: 2012-05-04
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?
0
Comment
Question by:prosoftsolutionsinc
9 Comments
 
LVL 23

Accepted Solution

by:
b1xml2 earned 100 total points
ID: 6874206
<script language="javascript">
//window.resizeTo(<width>,<height>);
window.resizeTo(400,500);

</script>
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6874221
//window.resizeBy(<width>,<height>);
window.resizeBy(300,-100);

resizing browsers thru the window object, nothing to do with the body tag.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6874240
the code is cross-browser =)
window.resizeTo is an absolute method
window.resizeBy is a relative method
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 18

Expert Comment

by:bruno
ID: 6875952
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>

0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6876043
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>
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6876221
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.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7048011
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&

0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7065639
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&
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7066979
Thanks, Cd&, for your help here.

This has been finalized today, and monitoring for comments.

Moondancer - EE Moderator
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Read about why website design really matters in today's demanding market.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

803 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