Three ways to make a full screen page

The easiest way is use window.open to open a full screen page:

<script>
<!--
function fullwin(){
window.open("bigpage.html","bfs","fullscreen,scrollbars")
}
//-->

</script>
<center>
<form>
<input type="button" onClick="fullwin()" value="Open Full Screen Window">
</form>
</center>

However, if you want to make a page which is already opened to full screen, please try the following code:

A. Use ActiveX
<html>
<head>
<title>test</title>
<script language="JavaScript">
function Fkey(){
var WsShell = new ActiveXObject('WScript.Shell')
WsShell.SendKeys('{F11}');
}

</script>
</head>
<body>
<a href="javascript:Fkey()">to full</a>
</body>
</html>

B. Use window.open to open the current page

<SCRIPT language="JavaScript">
function toFull(){
if(window.name=="fullscreen")return;
var a =window.open("","fullscreen","fullscreen=yes")
a.location = window.location.href
window.opener=null
window.close()
}

</SCRIPT>
<html>
<body>
<input type=button value="full" onclick=toFull()>
</body>
</html>

0 comments