IFrame for Fullscreen Test

Size
2,081 Kb
Views
30,360

How do I make an iframe for fullscreen test?

What is a iframe for fullscreen test? How do you make a iframe for fullscreen test? This script and codes were developed by Microsoft Edge Docs on 13 August 2022, Saturday.

IFrame for Fullscreen Test Previews

IFrame for Fullscreen Test - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>iFrame for Fullscreen Test</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="fullScreen"> Click to Toggle Fullscreen
</div> <script src="js/index.js"></script>
</body>
</html>

IFrame for Fullscreen Test - Script Codes CSS Codes

div { font-family: Segoe, sans-serif; width: 250px; height: 40px; background-color: dodgerBlue; overflow: hidden; text-align: center; margin: 0 auto; padding-top: 20px;
}

IFrame for Fullscreen Test - Script Codes JS Codes

// set up any div with fullscreen class to go full screen when clicked
var inFullScreen = false;
var fsClass = document.getElementsByClassName("fullScreen");
for (var i = 0; i < fsClass.length; i++) { fsClass[i].addEventListener("click", function (evt) { if (inFullScreen == false) { makeFullScreen(evt.target); // open to full screen } else { reset(); } }, false);
}
document.addEventListener("MSFullscreenError", function (evt) { console.error("full screen error has occured " + evt.target);
}, true);
// request full screen across several browsers
function makeFullScreen(divObj) { if (divObj.requestFullscreen) { divObj.requestFullscreen(); } else if (divObj.msRequestFullscreen) { divObj.msRequestFullscreen(); } else if (divObj.mozRequestFullScreen) { divObj.mozRequestFullScreen(); } else if (divObj.webkitRequestFullscreen) { divObj.webkitRequestFullscreen(); } inFullScreen = true; return;
}
// reset full screen across several browsers
function reset() { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } inFullScreen = false; return;
}
IFrame for Fullscreen Test - Script Codes
IFrame for Fullscreen Test - Script Codes
Home Page Home
Developer Microsoft Edge Docs
Username MicrosoftEdgeDocumentation
Uploaded August 13, 2022
Rating 3
Size 2,081 Kb
Views 30,360
Do you need developer help for IFrame for Fullscreen Test?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Microsoft Edge Docs (MicrosoftEdgeDocumentation) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!