捕获Chrome浏览器全屏退出事件

参考地址

document.addEventListener("fullscreenchange", function(e) {
  console.log("fullscreenchange", e);
});
document.addEventListener("mozfullscreenchange", function(e) {
  console.log("mozfullscreenchange ", e);
});
document.addEventListener("webkitfullscreenchange", function(e) {
  console.log("webkitfullscreenchange", e);
});
document.addEventListener("msfullscreenchange", function(e) {
  console.log("msfullscreenchange", e);
});

解决方法:

 document.addEventListener("webkitfullscreenchange", function (e) {
            if (e.currentTarget.webkitIsFullScreen) {
                //注意:这里的frames[id],id是拓扑图监控的菜单id,如果菜单id变了,这里也要相应的变化
                $("#fullscreen1", window.frames['name'].document).hide();
                $("#quitfullscreen", window.frames['name'].document).show();
            } else {
                $("#fullscreen1", window.frames['name'].document).show();
                $("#quitfullscreen", window.frames['name'].document).hide();
            }
        }, false);

 

posted @ 2015-09-28 17:30  Seaurl  阅读(2648)  评论(0编辑  收藏  举报