FullScreenChange event not work

匿名 (未验证) 提交于 2019-12-03 00:56:02

问题:

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');     } }); 

回答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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!