1

I want a browser to go full screen as soon as my page loads. Is it possible in javascript. I know the shortcut key for this F11 but requirement is on page load only.

After reading the solution provided below. I achieved full screen but here i got a trap. I was using timer to make my page postback to get fresh data after every 5 second. And here I found after every 5 sec new window opens up but I want full screen to go only once and next time content gets refreshed there itself.

Shantanu Gupta
  • 20,688
  • 54
  • 182
  • 286
  • Kiosk mode (full screen with hidden menu, which F11 does) can't be done through Javascript for security reasons. Related: http://stackoverflow.com/questions/1125084/how-to-make-in-javascript-full-screen-windows-stretching-all-over-the-screen – tadamson Sep 14 '10 at 06:14

4 Answers4

2
function OpenfullScreen(URL) {
    window.open(URL, '', 'fullscreen=yes, scrollbars=auto');
}

call this function from where you are opening the page

Bala
  • 1,386
  • 1
  • 14
  • 27
  • 2
    Is this even allowed and not blocked by the browser? Be cause I would harm anyone who whould do this without warning. – RvdK Sep 14 '10 at 06:09
2

you can use the window.open('yourlocation.htm', 'New window name', 'fullscreen=1');

NOTE THAT fullscreen is ONLY supported in I.E. browser. Not recommended to use since it is browser dependent.

Function Specification

the format of window.open() is window.open (URL, windowName[, windowFeatures])

URL is the URL page you trying to open windowName is the name given to this window

Windowfeatures is the additional parameter you would like this window to have

  • status -status bar at the bottom of the window. e.g. "status=1"
  • toolbar -standard browser toolbar, with Back and Forward button etc. e.g. "toolbar=0" mean no toolbar location
  • Location entry field where you enter the URL. e.g. "location=0"
  • menubar -menu bar of the window e.g. "menubar=1"
  • directories -The standard browser directory buttons e.g. "directories=1"
  • resizable -Allow/Disallow the user to resize the window. e.g. "resizble=0"
  • scrollbars -Enable the scrollbars if the document is bigger than the window e.g. "scrollbars=1"
  • height -Specifies the height of the window in pixels
  • width -Specifies the width of the window in pixels.
calculus1985
  • 199
  • 1
  • 4
1
function OpenfullScreen(URL) {
    window.open(URL, '', 'fullscreen=yes, scrollbars=auto, resizble=yes, status=yes, toolbar=yes,menubar=yes, scrollbars=no');
}

You can specify the width and height of the page too.

Anirudh Ramanathan
  • 46,179
  • 22
  • 132
  • 191
user496879
  • 11
  • 1
0

you can use <meta http-equiv="refresh" content="5" /> to refresh the browser in every 5 seconds.

place this code in the new window instead of the one that call it

calculus1985
  • 199
  • 1
  • 4