Solved

HTML Window Resize in <Body> tag?

Posted on 2002-03-17
9
321 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Un-Indent Setting Notepad++ 3 35
Unexpected End of File 11 84
Set a parameter in a properties file and use in html table. 14 58
transfer content to new site design 7 48
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

734 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