Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
is there any way to enter into fullscreen mode onload of page?

I am working on quiz and want to convert the screen into fullscreen mode on load of page for specific time, is there any way to achieve this or any alternative?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

User interaction is required to enter full-screen mode. This is a security feature.

Imagine being able to force a popup window of some kind to go full screen, lock the mouse pointer, and play an ad without permission. Having an "Enable Full Screen" link or button whose visibility is toggled in the "Change Full Screen" event handler in the the documentation seems like a pragmatic/better approach.

Even if you'll try, you will get the following error message

Failed to execute 'requestFullScreen' on 'Element': API can only be initiated by a user gesture.

So, It's not possible to load a page on fullscreen mode but you can use the following code to trigger it on some action:

<script>
/* Get the documentElement (<html>) to display the page in fullscreen */
var elem = document.documentElement;

/* View in fullscreen */
function openFullscreen() {
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.webkitRequestFullscreen) { /* Safari */
    elem.webkitRequestFullscreen();
  } else if (elem.msRequestFullscreen) { /* IE11 */
    elem.msRequestFullscreen();
  }
}

/* Close fullscreen */
function closeFullscreen() {
  if (document.exitFullscreen) {
    document.exitFullscreen();
  } else if (document.webkitExitFullscreen) { /* Safari */
    document.webkitExitFullscreen();
  } else if (document.msExitFullscreen) { /* IE11 */
    document.msExitFullscreen();
  }
}
</script>

Reference: w3Schools - Full Screen

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!