I went through more than 10 questions with same content but not to find a updated answer. (world of web is changing rapidly I guess). First thing is, is it possible to put current window full screen simulating F11 press on a user button click. also what is the best practice for doing it if I want the function to work in all major browsers (IE, FF, Chrome and Safari).
How to make in Javascript full screen windows (stretching all over the screen)
Simulate F11 with javascript
onclick go full screen
including above links I went through lot of questions but had no susses. Its really helpful if someone can come up with an idea. Thanks.
maybe this can help you example of full screen using the blog post Native Fullscreen JavaScript API (plus jQuery plugin)
This question is possibly a duplicate of a question you linked to. The latest cross-browser solution is:
function requestFullScreen(elt) {
console.log("Requesting fullscreen for", elt);
if (elt.requestFullscreen) {
elt.requestFullscreen();
} else if (elt.msRequestFullscreen) {
elt.msRequestFullscreen();
} else if (elt.mozRequestFullScreen) {
elt.mozRequestFullScreen();
} else if (elt.webkitRequestFullscreen) {
elt.webkitRequestFullscreen();
} else {
console.error("Fullscreen not available");
}
}
Please note that this is "experimental technology" as of this post. See this answer and this MDN page for more details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With