浏览代码

Add IE 11 fullscreen support.

pull/5/head
Matthew Petroff 11 年前
父节点
当前提交
79521c6d4b
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. +7
    -1
      src/js/pannellum.js

+ 7
- 1
src/js/pannellum.js 查看文件

@@ -74,9 +74,11 @@ function init() {
document.addEventListener('onresize', onDocumentResize, false);
document.addEventListener('mozfullscreenchange', onFullScreenChange, false);
document.addEventListener('webkitfullscreenchange', onFullScreenChange, false);
document.addEventListener('msfullscreenchange', onFullScreenChange, false);
document.addEventListener('fullscreenchange', onFullScreenChange, false);
document.addEventListener('mozfullscreenerror', fullScreenError, false);
document.addEventListener('webkitfullscreenerror', fullScreenError, false);
document.addEventListener('msfullscreenerror', fullScreenError, false);
document.addEventListener('fullscreenerror', fullScreenError, false);
window.addEventListener('resize', onDocumentResize, false);
document.addEventListener('keydown', onDocumentKeyPress, false);
@@ -662,6 +664,8 @@ function toggleFullWindow() {
page.requestFullscreen();
} else if (page.mozRequestFullScreen) {
page.mozRequestFullScreen();
} else if (page.msRequestFullscreen) {
page.msRequestFullscreen();
} else {
page.webkitRequestFullScreen();
}
@@ -675,6 +679,8 @@ function toggleFullWindow() {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}

if(popoutMode) {
@@ -685,7 +691,7 @@ function toggleFullWindow() {
}

function onFullScreenChange() {
if(document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen) {
if(document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement) {
document.getElementById('fullwindowtoggle_button').classList.add('fullwindowtoggle_button_active');
fullWindowActive = true;
} else {


正在加载...
取消
保存