FullScreenChange event not work
12,367
Solution 1
You probably need to use the vendor specific prefix for the document.fullScreen
property
var isFullScreen = document.fullScreen ||
document.mozFullScreen ||
document.webkitIsFullScreen;
Further information available here:
https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode
Solution 2
This worked for me:
window.onresize = resize
function resize() {
//code
}
Author by
Aleksov
Updated on June 14, 2022Comments
-
Aleksov almost 2 years
I try bind FullScreenChange event, but it not work. Maybe i did something wrong?
$(document).bind('webkitfullscreenchange mozfullscreenchange fullscreenchange',function(){ if(document.fullScreen){ console.log('Go to Full Screen mode'); }else{ console.log('Exit Full Screen mode'); } });