fullScreen.html

时间:2023-03-09 08:10:51
fullScreen.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>index</title>
</head>
<body>
<input type="button" value="全屏显示" onclick="fullScreen()">
<script> function fullScreen() {
var el = document.documentElement;
var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen; if (typeof rfs !== "undefined" && rfs) {
rfs.call(el);
} else if (typeof window.ActiveXObject !== "undefined") {
// for Internet Explorer
var wscript = new ActiveXObject("WScript.Shell");
wscript.SendKeys("{F11}");
}
} </script>
</body>
</html>