Fullscreen API: Which events are fired?

后端 未结 3 2011
逝去的感伤
逝去的感伤 2020-11-29 05:10

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:

3条回答
  •  孤独总比滥情好
    2020-11-29 05:50

    Your link shows the answer...

    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.

提交回复
热议问题