<html>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script src="/static/js/jquery-3.3.1.min.js"></script>
<script src="/static/jquery-3.3.1.min.js"></script>
<style>
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
overflow: hidden;
}
</style>
<body>
<div>
<button id="btn">全屏展示</button>
<div id="content">
<iframe src="https://www.taobao.com" width='100%' height='100%' frameborder='0' name="_blank"
id="_blank"></iframe>
</div>
</div>
</body>
//全屏代码
<script language="javascript">
document.getelementbyid("btn").onclick = function () {
var elem = document.getelementbyid("_blank");
var h1 = document.getelementbyid("h1");
requestfullscreen(elem);// 某个页面元素
//requestfullscreen(document.documentelement);// 整个网页
};
function requestfullscreen(element) {
// 判断各种浏览器,找到正确的方法
var requestmethod = element.requestfullscreen || //w3c
element.webkitrequestfullscreen || //chrome等
element.mozrequestfullscreen || //firefox
element.msrequestfullscreen; //ie11
if (requestmethod) {
requestmethod.call(element);
}
else if (typeof window.activexobject !== "undefined") {//for internet explorer
var wscript = new activexobject("wscript.shell");
if (wscript !== null) {
wscript.sendkeys("{f11}");
}
}
}
//退出全屏 判断浏览器种类
function exitfull() {
// 判断各种浏览器,找到正确的方法
var exitmethod = document.exitfullscreen || //w3c
document.mozcancelfullscreen || //chrome等
document.webkitexitfullscreen || //firefox
document.webkitexitfullscreen; //ie11
if (exitmethod) {
exitmethod.call(document);
}
else if (typeof window.activexobject !== "undefined") {//for internet explorer
var wscript = new activexobject("wscript.shell");
if (wscript !== null) {
wscript.sendkeys("{f11}");
}
}
}
</script>
<script>
$(document).ready(function () {
settimeout(function f() {
$('iframe').attr("src", "https://www.baidu.com")
}, 30000);
settimeout(function ff() {
$('iframe').attr("src", " https://www.taobao.com ")
}, 60000);
}
setinterval(function ffff() {
settimeout(function f() {
$('iframe').attr("src", " https://www.baidu.com ")
}, 30000);
settimeout(function ff() {
$('iframe').attr("src", " https://www.taobao.com ")
}, 60000);
}, 90000);}
</script>
</html>