views:

1779

answers:

4

Hi,

I would like to open my html page in fullscreen mode. I tried to execute this javascript in body's onload event handler.

window.fullScreen = true;

But unfortunately that doesn't seem to be working. Is there any other way with which we can achieve the same.

Thanks, Shafi

A: 

window.open(href, windowname, ',type=fullWindow,fullscreen,scrollbars=yes');

take it from link : http://www.htmlcodetutorial.com/linking/linking_famsupp_87.html

Haim Evgi
+1  A: 

I'm pretty sure that most browsers block this nowadays as it's annoying.

Mez
A: 

I dont think you can set the windows properties by using the onload event. Try setting the properties as you open the window. This should work...

<div onclick="window.open('http://stackoverflow.com', 'Stackoverflow' , 'type=fullWindow, fullscreen, scrollbars=yes');">
    Hello Stackoverflow!
</div>
Chalkey
I will throw in that this doesn't actually produce a fully "full screen" window. It's just a window that is just as wide and just as tall as the screen, and still has a location bar. There is no way to produce something fully fullscreen from a webpage. (unless you use flash)
Breton
+2  A: 

This is unadvisable as it results in unexpected browser behviour for the user. For this reason, many browsers no longer let unprivileged scripts modify this setting.

For example, from Mozilla Developer Center

With chrome privileges, the property is read-write, otherwise it is read-only.

See https://developer.mozilla.org/En/DOM/Window.fullScreen

Jonathan Fingland