Solved

HTML Window Resize in <Body> tag?

Posted on 2002-03-17
9
310 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
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now