<!DOCTYPE html>
<html>
<head>
<style>
#MyBox{
background-color:#f2f2f2;
padding:5px;
text-align:center;
}
</style>
</head>
<body>
<div id="MyBox">
<p>سایت آموزشی فری لرن</p>
<p>سایت آموزشی فری لرن</p>
<p>سایت آموزشی فری لرن</p>
<button onclick="ShowFullScreen();">باز کردن بصورت تمام صفحه</button>
<br><br>
<button onclick="HideFullScreen();">از حالت تمام صفحه خارج کردن</button>
</div>
<script>
function ShowFullScreen(){
var MyBox;
MyBox = document.getElementById("MyBox");
if ( MyBox.requestFullscreen ) {
MyBox.requestFullscreen();
}else if( MyBox.webkitRequestFullscreen ) {
MyBox.webkitRequestFullscreen();
}else if( MyBox.mozRequestFullscreen ) {
MyBox.mozRequestFullscreen();
}else if( MyBox.msRequestFullscreen ) {
MyBox.msRequestFullscreen();
}
}
function HideFullScreen(){
if ( document.exitFullscreen ) {
document.exitFullscreen();
}else if( document.webkitExitFullscreen ) {
document.webkitExitFullscreen();
}else if( document.mozExitFullscreen ) {
document.mozExitFullscreen();
}else if( document.msExitFullscreen ) {
document.msExitFullscreen();
}
}
</script>
</body>
</html>