Use javaScript to make an existing window full screen?

I want to toggle a normal browser window between normal and full screen by cliking a button on the page within the window.  Is it possible to take a browser window that was opened normally and make it full screen?
Who is Participating?
ZylochConnect With a Mentor Commented:
Like the others said, it's pretty impossible to make current window fullscreen.

You can use tusharashah's method, although the title bar, etc., unless you make the moveTo a negative amount and the browser width, height, a greater amount than the screen, for instance,

If the title bar is 50px (I'm not sure what it is, you'd use):
and the status bar is also 50px (again, not sure what it is):


The -50 hides the title bar and the positive 100 should theoretically hide the status bar and the title bar.

Another method would be to close the current window and open a new one. Again, this may not be most desirable, for instance, if there are POST variables, it could get a bit messy with hidden forms and such, but the general concept is follows:

function btnOnClick() {
   if (window.location.href.indexOf("fullscreen=yes")==-1) {"?fullscreen=yes","someWinTitle","fullscreen,scrollbars");
   } else {,""),"someWinTitle");
<script language="JavaScript">
<!-- ("", "","fullscreen=yes")
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Paste this code to the HEAD of your html document.

function fullwin(){"","bfs","fullscreen,scrollbars")

<input type="button" onClick="fullwin()" value="Open Full Screen Window">

where is the address you need ot change it could be contact.html or (if the page you are re-directing to is already uploaded on the serveR)

P.S:- Trying using Microsoft Frontpage if you could.
soBCAuthor Commented:
Thanks for the responses, but the window I need to toggle is existing.  I dont want to open a new window in full screen mode...I want to take an existing window that is not in full screen mode and change it to full screen by clicking a button and invoking some JavaSciprt/dHTML/etc...
tusharashahConnect With a Mentor Commented:
On the OnClick event of your button add following JavaScript to make your window Full Screen:

function btnOnClick()

sorry, i didn't get ya.
PodExpertConnect With a Mentor Commented:
However, after installing Windows XP Service Pack 2, you will not be able to create a window greater than the screen, there are also some additional restrictions (applies only to Internet Explorer, of course). Using Zylochs method is therefor not recommended, because it will not work on updated systems with IE.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.