I want to make the entire document fullscreen after loading:
<script type="text/javascript">
function launchIntoFullscreen(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if(element.msRequestFullscreen) {
element.msRequestFullscreen();
}
}
$(document).ready(function() {
launchIntoFullscreen(document.documentElement);
});
</script>
At runtime the document is not fullscreen; when I inspected the document the console displayed this:
The access to the full screen application was refused because Element.mozRequestFullScreen() was not called within a user-generated event handler
It said that there must be an event manager which should be generated and from which to call the function. So how do I create this event manager? And how do I call the function from it?