全屏API:触发了哪些事件? [英] Fullscreen API: Which events are fired?

查看:166
本文介绍了全屏API:触发了哪些事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道当用户通过新的全屏API 。我试过这个代码片段,但它不会触发:

I need to know which (DOM) events are fired when a user enter the fullscreen mode via the new Fullscreen API. I tried for example this snippet but it doesn't fire:

jQuery('body').on('fullScreenChange', function() { alert("Fired!"); });


推荐答案

您的链接显示答案 ...


成功启用全屏模式后,包含全屏元素的文档会收到 fullscreenchange 事件。退出全屏模式时,文档再次收到 fullscreenchange 事件。请注意, fullscreenchange 事件本身不会提供有关文档是进入还是退出全屏模式的任何信息,但是如果文档具有非null fullScreenElement ,你知道你处于全屏模式。

When full-screen mode is successfully engaged, the document which contains the full-screen element receives a fullscreenchange event. When full-screen mode is exited, the document again receives a fullscreenchange event. Note that the fullscreenchange event doesn't provide any information itself as to whether the document is entering or exiting full-screen mode, but if the document has a non null fullScreenElement , you know you're in full-screen mode.

这篇关于全屏API:触发了哪些事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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