最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - FullScreenChange event not work - Stack Overflow

programmeradmin1浏览0评论

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

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');
    }
});
Share Improve this question asked Jan 27, 2013 at 16:39 AleksovAleksov 1,2305 gold badges18 silver badges28 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 15

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/en-US/docs/DOM/Using_fullscreen_mode

This worked for me:

window.onresize = resize
function resize() {
  //code
}
发布评论

评论列表(0)

  1. 暂无评论