IE11 does not listen on MSFullscreenChange event

I am trying to use fullscreen mode in IE11 using Bigscreen.js. But IE11 does not listen for the "MSFullscreenChange" event.

document.addEventListener("MSFullscreenChange", function () {
          if (document.msFullscreenElement != null) {
              console.info("Went full screen");
          } else {
              console.info("Exited full screen");              
          }
      });

By placing this in the console, it does not print anything in full screen mode. What is an alternative way to detect this event?

+4
source share
2 answers

Actually, the Microsoft documentation is incorrect.

I am testing IE11 and it does not have an event listener MSFullscreenChange. Instead, it has an event handler onmsfullscreenchange.

So, just change this and your code should work.

0
source

http://brad.is/coding/BigScreen/, F12 Developer Tools, script " script", " " , .

" script" Ctrl + Enter, script . Enter script. , script . "Enter" script .

: , Microsoft Fullscreen API.

-1

Source: https://habr.com/ru/post/1524659/


All Articles