Javascript within page to open fullscreen
I have a htm page that I need to update so that wh开发者_如何学运维en it is opening it will open at fullscreen. What is the code that I need to place within this page to do so?
Most browsers don't support opening windows in fullscreen. I suggest you only use the document size you are given.
This is not possible.
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.
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.
精彩评论