有什么办法可以在页面加载时进入全屏模式吗?
我正在做测验,并希望在特定时间内将屏幕转换为加载页面时的全屏模式,有什么方法可以实现此目的或任何替代方案吗?
I am working on quiz and want to convert the screen into fullscreen mode on load of page for specific time, is there any way to achieve this or any alternative?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
需要用户交互才能进入全屏模式。这是一项安全功能。
想象一下能够强制某种弹出窗口全屏显示、锁定鼠标指针以及未经许可播放广告。
具有“启用全屏”链接或按钮,其可见性在“更改全屏”事件处理程序中切换
该文档似乎是一种务实/更好的方法。
即使您尝试,您也会收到以下错误消息
因此,不可能在全屏模式下加载页面,但您可以使用以下代码在某些操作上触发它:
参考:w3Schools - 全屏
User interaction is required to enter full-screen mode. This is a security feature.
Imagine being able to force a popup window of some kind to go full screen, lock the mouse pointer, and play an ad without permission.
Having an "Enable Full Screen" link or button whose visibility is toggled in the "Change Full Screen" event handler in the
the documentation seems like a pragmatic/better approach.
Even if you'll try, you will get the following error message
So, It's not possible to load a page on fullscreen mode but you can use the following code to trigger it on some action:
Reference: w3Schools - Full Screen