Josh
Josh

Reputation: 1911

Javascript within page to open fullscreen

I have a htm page that I need to update so that when it is opening it will open at fullscreen. What is the code that I need to place within this page to do so?

Upvotes: 0

Views: 246

Answers (4)

Seth
Seth

Reputation: 772

You can't (and shouldn't) force fullscreen, but you can (though probably shouldn't) use Javascript to maximize the window size:

window.outerWidth = screen.availWidth;
window.outerHeight = screen.availHeight;

But as previous people have stated, resizing a user's window is likely going to annoy him.

If fullscreen is really important for your application, you might consider giving the user instructions to switch to this mode manually. You COULD use Javascript to customize these instructions to a users' browser/OS.

Upvotes: 0

Keith Adler
Keith Adler

Reputation: 21178

Don't do this. Firefox doesn't implement this because people just don't like it. You should assume users have their browser the size they want for a reason.

Upvotes: 0

tcooc
tcooc

Reputation: 21279

Most browsers don't support opening windows in fullscreen. I suggest you only use the document size you are given.

Upvotes: 1

SLaks
SLaks

Reputation: 888283

This is not possible.

Upvotes: 0

Related Questions