急,求跳转全屏的方法 javascript
问题在此http://zhidao.baidu.com/question/1639809807056517340.html...
问题在此
http://zhidao.baidu.com/question/1639809807056517340.html 展开
http://zhidao.baidu.com/question/1639809807056517340.html 展开
1个回答
展开全部
--使用screenfull.js 这个插件可以让任意浏览器全屏
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script src="http://cdn.bootcss.com/screenfull.js/2.0.0/screenfull.js"></script>
</head>
<body>
<button class="am-btn am-btn-primary" id="doc-fs-request" onclick="full()">全屏窗口</button>
<script type="text/javascript">
function full(){
var docElm = document.documentElement;
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
}
else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
}
else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
}
}
</script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script src="http://cdn.bootcss.com/screenfull.js/2.0.0/screenfull.js"></script>
</head>
<body>
<button class="am-btn am-btn-primary" id="doc-fs-request" onclick="full()">全屏窗口</button>
<script type="text/javascript">
function full(){
var docElm = document.documentElement;
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
}
else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
}
else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
}
}
</script>
</body>
</html>
追问
不能跳转啊
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |