如何创建ASP网站支持全屏? [英] How can I create a ASP website support fullscreen?

查看:140
本文介绍了如何创建ASP网站支持全屏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是创建一个新的网站,我需要制作一个全屏按钮,当用户点击它所有页面显示为全屏



什么我试过了:



我搜索它并且有我的尝试:



< ; input type =buttonvalue =click to toggle fullscreen>

< input type =buttonvalue =goto>



这是函数



函数toggleFullScreen(){

if((document.fullScreenElement&& document) .fullScreenElement!== null)||

(!document.mozFullScreen&&!document.webkitIsFullScreen)){

if(document.documentElement.requestFullScreen){

document.documentElement.requestFullScreen();

} else if(document.documentElement.mozRequestFullScreen){

document.documentElement.mozRequestFullScr een();

} else if(document.documentElement.webkitRequestFullScreen){

document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);

}

} else {

if(document.cancelFullScreen){

document.cancelFullScreen();

} else if(document.mozCancelFullScreen){

document.mozCancelFullScreen();

} else if(document.webkitCancelFullScreen){

document.webkitCancelFullScreen ();

}

}



}



函数func(){

window.location.replace(second.aspx);

}



这样可以在全屏显示页面,但问题是它何时重定向到第二页不支持全屏加载



这里是第二页的代码



document.addEventListener (DOMContentLoaded,函数(事件){

toggleFullScreen();

});



my问题现在有没有其他方法可以使所有网站从索引页面支持全屏模式?

I aim to create a new Website, I need to make a button of fullscreen, when user click it all pages showed as full screen

What I have tried:

I search it and there is my trying:

<input type="button" value="click to toggle fullscreen" >
<input type="button" value="goto" >

and this is function

function toggleFullScreen() {
if ((document.fullScreenElement && document.fullScreenElement !== null) ||
(!document.mozFullScreen && !document.webkitIsFullScreen)) {
if (document.documentElement.requestFullScreen) {
document.documentElement.requestFullScreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullScreen) {
document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}

}

function func() {
window.location.replace("second.aspx");
}

this works fine to show page in full screen but the problem is when it redirect to the second page it didn't support full screen on load

here is the code of second page

document.addEventListener("DOMContentLoaded", function (event) {
toggleFullScreen();
});

my question now is there any other way to make the all site support full screen mode from index page ?

推荐答案

使用合适的库读取系统环境。

和按钮点击设置屏幕大小作为您的网站页面大小。

这将使您的网站看起来像模式:适合屏幕。
Read system environment using suitable library.
and on button click set screen size as your web sites page size.
this will make your website look like mode: fit to screen.


这篇关于如何创建ASP网站支持全屏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆