Solved

Maximize page size automaticaly

Posted on 2001-08-28
8
214 Views
Last Modified: 2010-05-18
what is the correct syntax to force a site to open completely(taking up the entire screen ) regardless
of what resolution and monitor size the user is using?
0
Comment
Question by:jriver12
8 Comments
 
LVL 2

Expert Comment

by:tewald
ID: 6433292
Here you go:
<html>
<head>
<title></title>
<script>
function openNew() {
var w = screen.availWidth||screen.width
var h = screen.availHeight||screen.height
     window.open('pageToOpen.html','openWindow','toolbar, menubar, location, width='+w+', height='+h);
}
</script>
</head>
<body>
<a href="#" onclick=openNew();>Click</a>
</table>
</body>
</html>
0
 

Author Comment

by:jriver12
ID: 6433856
this looks alot like opening a child window, if it is, I need to know if there is a way to force the parent window to open entirely?
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6434107
<SCRIPT>
var w = screen.availWidth||screen.width
var h = screen.availHeight||screen.height
window.moveTo(0,0)
window.resizeTo(w,h)
</SCRIPT>

0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:jriver12
ID: 6434322
how would I call this script?

would it be <body onload="?".

the above has no function name(ie previous was "function openNew()"  would this one be if I was to choose resizewin()? or am I off track here?
0
 
LVL 8

Accepted Solution

by:
bebonham earned 25 total points
ID: 6434385
well, you don't really need a function for your purposes...

the window is already created, so you don't have to wait for the document (body onload) to load to do this.

the code will automatically execute whenever the page is loaded or refreshed.

but if you really wanted to you could do something like

<SCRIPT>
var w = screen.availWidth||screen.width
var h = screen.availHeight||screen.height
function full()
{
window.moveTo(0,0)
window.resizeTo(w,h)
}
window.onload=full
window.onresize=full
</SCRIPT>

and then it will stay full screen :)
also, I believe that window.onload is identical to <body onload>

however the first method is perfectly adequate.

Bob

0
 
LVL 2

Expert Comment

by:Ixeus
ID: 6436034
There is a problem with setting screen to a fixed size the way you did it, that is not a BIG problem, just a hassle... it isn't TRUELY maximise...?

You'll if you take your mouse to the bottom of the screen, that it will allow you to resize it.  Which you don't get when you're maximised.  (you'll also notice the top icon would show "Maximise", not the "sub minimize" as it should... it's not truely maximized =(

But there is no alternative, (it seems?)

I know there is a function that allows you to set the min/max status of your window........ but I can't find it anywhere even on msdn :/


~Ixeus
0
 
LVL 8

Expert Comment

by:bebonham
ID: 6436217
that only works in ie, and it only works on new windows.

since the window covers the screen, I don't see what the difference is...the little in the corner doesn't really matter.
0
 

Author Comment

by:jriver12
ID: 6452899
bebonham,
Thank you for the help.  I am sorry for the delay in releasing the points, I have recently become OBE.

thanks again.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JS does not refresh 6 28
Dynamic Dropdowns 15 32
How to deal with the query string 8 37
How can I use an anonymous question as a Google Maps call-back function? 4 24
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

792 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