Can I make a button reading (full screen) that is equal to pressing f11?
can I make users press a button on my website (on the header) and do the same thing as anpress of F11 to go to fullscreen?
Best Answer
-
This is a bit technical, but there's a browser method for
element
objects that can be used to toggle full screen. https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreenHere are a few sources that provide relevant scripts. You will need to modify the HTML of the button to have the appropriate CSS selector to call the function on click, or will need to add the onclick for the function call to the button itself.
- Informative post by google: https://developers.google.com/web/fundamentals/native-hardware/fullscreen
- https://stackoverflow.com/questions/7836204/chrome-fullscreen-api
- https://webdevpuneet.com/web-browsers-full-screen-f11-toggle-function-on-a-web-page/#gsc.tab=0
If you're unfamiliar with HTML, CSS, and JavaScript, I recommend saving a site backup before making any changes, or using a site that can be deleted first, to test, if you try to implement it on your own. That, or you can hire a developer in the Duda Experts program to implement this for you on your site.
3
Answers
-
You can with some fancy <script>, but my question would be "Why?" when the user can just press F11.
0 -
I agree, why would you want to do this? I'd be talking my client out of it ...
0 -
Can you post the script for me? I want every user on my website to press that button for an immersive experience. Most users don't usually use F11 often or don't know about it
0 -
here's my website niudavinci.multiscreensite.com
0 -
Like @Elizabeth_Fedak mentioned, it can get VERY TECHNICAL. If you can not use the article above to set it up on your site, then we recommend hiring a developer from the Experts Portal.
2 -
Incredible, detailed answer!
1