我有一个页面正在检查用户是否离开全屏。我想删除/销毁此事件观察器,但无法在描述 API 描述中找到如何执行此操作 这是我的代码:
//create black background and disable scrolling
$rootScope.fullScreen = !$rootScope.fullScreen;
//make div fullScreen (Browser Native)
if($rootScope.fullScreen == true) {
var videoWindow = document.getElementById("full-screen");
if (videoWindow.requestFullscreen) {
videoWindow.requestFullscreen();
}
//check if user has closed fullscreen
document.onwebkitfullscreenchange = function ( event ) {
if(!document.webkitFullscreenElement) {
$rootScope.fullScreen = false;
//REMOVE THE EVENTHANDLER - STOP WATCHING!
?????????
}
};