全屏API:触发了哪些事件? [英] Fullscreen API: Which events are fired?
问题描述
我需要知道当用户通过新的全屏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
事件本身不会提供有关文档是进入还是退出全屏模式的任何信息,但是如果文档具有非nullfullScreenElement
,你知道你处于全屏模式。
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 afullscreenchange
event. Note that thefullscreenchange
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 nullfullScreenElement
, you know you're in full-screen mode.
这篇关于全屏API:触发了哪些事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!