To achieve a fullscreen effect, you need to take two steps: first, make the window fill the entire screen, and then ensure that the <iframe>
also occupies the whole area.
You can use JavaScript to enable fullscreen mode, similar to what is explained in this Stack Overflow response.
Next, to expand the iframe to full size, apply certain styles as shown below. The provided JS snippet applies a class containing these styles to the <iframe>
.
JavaScript:
document.getElementsByTagName("iframe")[0].className = "fullScreen";
CSS:
body, html {
height: 100%;
margin: 0;
}
.fullScreen {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
View an example with this setup on JSFiddle at this demo link.
*Please note that this JSFiddle example may not fully demonstrate the fullscreen functionality due to security restrictions, but it should work well for your implementation.