我尝试绑定FullScreenChange事件,但它不起作用。也许我做错了什么?
$(document).bind('webkitfullscreenchange mozfullscreenchange fullscreenchange',function(){
if(document.fullScreen){
console.log('Go to Full Screen mode');
}else{
console.log('Exit Full Screen mode');
}
});
答案 0 :(得分:12)
您可能需要为document.fullScreen
属性
var isFullScreen = document.fullScreen ||
document.mozFullScreen ||
document.webkitIsFullScreen;
此处提供更多信息:
https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode
答案 1 :(得分:0)
这对我有用:
{{1}}