Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

How do i resize a window to full screen?!

Resize or resizing a window to full screen, Does this code exist?



12:35 am on Nov 23, 2008 (gmt 0)

5+ Year Member

I am building a webpage and need a code that will allow me to resize the current window to fullscreen. I first thought i could do it using a simple onLoad="blah blah" command or some kind of creative javascript/html tag but it has proven quite frustrating.

If anyone can help me please do. My continued mental stability and intelectual aragence depend on it!

For all of you that may have moral issues with traping users in a seemingly unescapeble fullscreen trap, rest assured its for personal use only.


1:00 am on Nov 23, 2008 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

welcome to WebmasterWorld [webmasterworld.com], Baxter30!

do you have any code to post that you have tried that "almost works"?

perhaps something like this will do your trick:
<title>Full Screen</title>
<script language="JavaScript" type="text/javascript">
function fullScreen(){
<body onLoad="fullScreen()">


1:32 am on Nov 23, 2008 (gmt 0)

5+ Year Member

The code you've posted is close but this function will only maximize the width and height of the screen. I am looking for a code that will resize to true fullscreen(all you will see is the content of the page and no address bar, toolbars, or status bar will be availible.

I can open a fullscreen window useing a code like this:


<body onLoad="window.open('indexh.html', 'index', 'fullscreen'); ">


But this will leave two windows open. I have tried combining this with onLoad="self.close()". But this will prompt the user to close the window, and thats just annoying. I've also tried to find ways to minimize the first window automatically after opening the second but failed(if anyone else can, toss it in).

I've seen others try things like this:

<script type="text/javascript">
function max()
var obj = new ActiveXObject("Wscript.shell");
<body onload="javascript:max()">

But most people don't like having thier computers invaded. And this aproach will prompt you relentlessly as well as not providing a true full screen effect(you can access the adress bar and tool bars). Got any other ideas?

[edited by: Baxter30 at 1:33 am (utc) on Nov. 23, 2008]


Featured Threads

Hot Threads This Week

Hot Threads This Month