开发者

How to make browser full screen on page load using javascript with timer control

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 wind开发者_Python百科ow opens up but I want full screen to go only once and next time content gets refreshed there itself.


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

call this function from where you are opening the page


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜