?
Solved

HTML Window Resize in <Body> tag?

Posted on 2002-03-17
9
Medium Priority
?
329 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 400 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

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.

Question has a verified solution.

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

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This video teaches users how to migrate an existing Wordpress website to a new domain.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month16 days, 6 hours left to enroll

850 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