检测如果浏览器是在全屏模式下 [英] Detecting if a browser is in full screen mode

查看:176
本文介绍了检测如果浏览器是在全屏模式下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有,如果浏览器在全屏模式下运行可靠地检测什么办法?我是pretty确保没有任何浏览器API我可以查询,但有没有人算出来通过检查和比较由DOM露出一定的高度/宽度测量?即使它仅适用于某些浏览器我有兴趣听一下吧。

Is there any way of reliably detecting if a browser is running in full screen mode? I'm pretty sure there isn't any browser API I can query, but has anyone worked it out by inspecting and comparing certain height/width measurements exposed by the DOM? Even if it only works for certain browsers I'm interested in hearing about it.

推荐答案

15的Chrome,火狐10和Safari 5.1,现在提供的API编程触发全屏模式。全屏模式触发这种方式提供的事件来检测全屏造型元素的全屏变化和CSS伪类。

Chrome 15, Firefox 10, and Safari 5.1 now provide APIs to programmatically trigger fullscreen mode. Fullscreen mode triggered this way provide events to detect fullscreen changes and CSS pseudo-classes for styling fullscreen elements.

请参阅这hacks.mozilla.org博客帖子了解详情。

这篇关于检测如果浏览器是在全屏模式下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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