Fullscreen API: Which events are fired?

后端 未结 3 2016
逝去的感伤
逝去的感伤 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:48

    I was using:

    $(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange', fn);
    

    It fires for Safari, Chrome, and Firefox (haven't tested others). There seems to be a subtle difference in the resulting context between webkit and moz, element height and width are different. But the events fire, which is your question.

    Oh. And watch out for using alert('fs') with full screen testing. It often interferes with the screen change.

提交回复
热议问题