I am developing a program for IE11 and I would like it to run in fullscreen mode using Fullscreen API (https://davidwalsh.name/fullscreen). Initially I had the issue that IE11 prevented the page from scrolling when in fullscreen mode, but solved that with this answer - IE cannot scroll while in fullscreen mode. However, now when IE11 enters fullscreen mode the entire page turns black except button images. I have tried editing the body
css by adding background-color: #ffffff;
and setting overflow:auto;
but nothing works. I would appreciate any ideas about how to correct the background color issue in fullscreen mode.
I have added a code sample as requested but unfortunately it looks like the stackoverflow code snippet disables Fullscreen API, and neither Codepen nor JSFiddle seem to work in IE11. Open to suggestions for how to test this code snippet across browsers.
function startExperiment() {
function goFullScreen(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.msRequestFullscreen) {
if (element === document.documentElement) {
//check element
element = document.body; //overwrite the element (for IE)
}
element.msRequestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
} else {
return; //if none are supported do not show message
}
}
var entire_page = document.documentElement; //entire page (for Chrome/FF)
goFullScreen(entire_page);
proceed();
}
function proceed() {
$("#participantInfoSheet").show();
$("#firstScreen").hide();
}
function checkBoxes() {
alert("box checked");
}
html,
body {
height: 100vh;
width: 100vw;
}
body {
margin: 0;
background-color: #ffffff;
backface-visibility: hidden;
padding: 0px;
text-align: center;
font-family: "Arial";
overflow: auto;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="firstScreen">
<div id="introText">
<br><br><br><br> The next page will run in full-screen mode.<br> When you are ready, click the START button.<br><br>
<button type="button" id="startExperimentButton" style="display:inline" onclick="startExperiment()">START</button>
</div>
</div>
<div id="participantInfoSheet" style="display:none; margin-left:10%; margin-right:10%;">
<br><br><br><br><br><br><br><br><br><br><br><br>More information is listed here. This is the page that turns black in full screen mode. <br><br><br>
<input type="button" onClick='window.print()' value='Print' /> <br><br>
<br><input type="checkbox" id="infoSheetCheckbox" onclick="checkBoxes()"> Users must check this box.<br><br>
</div>