如何在asp.net或javascript中将页面主体设置为全屏大小,如f11 [英] how to set body of page to full screen size like f11 in asp.net or javascript

查看:153
本文介绍了如何在asp.net或javascript中将页面主体设置为全屏大小,如f11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用于在线检查当用户点击开始检查时,页面应以全屏大小显示(F11),不应退出全屏,键盘控制不起作用。用javascript可以吗?如果有,请让我知道它是如何可能的......

for online examination when user clicks on start exam the page should be displayed in full screen size(F11) and should not exit full screen and the keyboard controls should not work. is it possible with javascript? if yes, please let me know how it is possible...

推荐答案

有一个实验性的全屏API,但它在浏览器之间并不一致:

http://caniuse.com/#feat=fullscreen [ ^ ]



GitHub上有一个项目尝试将这些更改隐藏在一致的API背后:

https://github.com/sindresorhus/screenfull。 js / [ ^ ]



然而,此API将 NOT 允许您在没有用户交互的情况下进入全屏模式,它将 NOT 阻止用户退出全屏模式。这是的事情。如果随机网站能够接管整个屏幕,并阻止您访问计算机上的任何其他内容,那将是一个主要的安全问题。
There is an experimental full-screen API, but it's not consistent between browsers:
http://caniuse.com/#feat=fullscreen[^]

There's a project on GitHub which attempts to hide these changes behind a consistent API:
https://github.com/sindresorhus/screenfull.js/[^]

However, this API will NOT allow you to enter full-screen mode without user interaction, and it will NOT prevent the user from exiting full-screen mode. And that's a good thing. If a random website was able to take over your entire screen, and prevent you from accessing anything else on your computer, that would be a major security problem.


这篇关于如何在asp.net或javascript中将页面主体设置为全屏大小,如f11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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