Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/390.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript extjs中的firefox无法全屏显示_Javascript_Jquery_Html_Css_Extjs - Fatal编程技术网

Javascript extjs中的firefox无法全屏显示

Javascript extjs中的firefox无法全屏显示,javascript,jquery,html,css,extjs,Javascript,Jquery,Html,Css,Extjs,我在chrome上全屏工作,它工作正常,但在mozilla上工作不正常。请帮助它。当我全屏工作时,图标会发生变化n当我回到原始屏幕时,图标会再次发生变化,这在firefox中无法正常工作 <div id="exitscreen" style="display:none;"><a href="#"> <img src="https://cdn1.iconfinder.com/data/icons/Icon_for_MealKeeper__s_soft_by_shlya

我在chrome上全屏工作,它工作正常,但在mozilla上工作不正常。请帮助它。当我全屏工作时,图标会发生变化n当我回到原始屏幕时,图标会再次发生变化,这在firefox中无法正常工作
<div id="exitscreen" style="display:none;"><a href="#">
<img src="https://cdn1.iconfinder.com/data/icons/Icon_for_MealKeeper__s_soft_by_shlyapnikova/full%20screen_16.png" id="cfullscreen"/></a></div>
extjs版本3.4, jquery 1.9

<script>

/* 
Native FullScreen JavaScript API
-------------
Assumes Mozilla naming conventions instead of W3C for now
*/

(function() {
var fullScreenApi = { 
    supportsFullScreen: false,
    isFullScreen: function() { return false; }, 
requestFullScreen: function() {}, 
cancelFullScreen: function() {},
fullscreenEnabled: function() {},
fullScreenEventName: '',
prefix: ''
},
browserPrefixes = 'webkit moz o ms khtml'.split(' ');

// check for native support
if (typeof document.cancelFullScreen != 'undefined') {
fullScreenApi.supportsFullScreen = true;
} else {     
    // check for fullscreen support by vendor prefix
    for (var i = 0, il = browserPrefixes.length; i < il; i++ ) {
    fullScreenApi.prefix = browserPrefixes[i];

    if (typeof document[fullScreenApi.prefix + 'CancelFullScreen' ] != 'undefined' ) {
    fullScreenApi.supportsFullScreen = true;

    break;
    }

    }
}

// update methods to do something useful
if (fullScreenApi.supportsFullScreen) {
    fullScreenApi.fullScreenEventName = fullScreenApi.prefix + 'fullscreenchange';

    fullScreenApi.isFullScreen = function() {
    switch (this.prefix) {  
    case '':
    return document.fullScreen;
    case 'webkit':
    return document.webkitIsFullScreen;
    case 'moz':
    return document.mozIsFullScreen;    
    default:
    return document[this.prefix + 'FullScreen'];
    }
    }
    fullScreenApi.requestFullScreen = function(el) {
    return (this.prefix === '') ? el.requestFullScreen() : el[this.prefix + 'RequestFullScreen']();
    }
    fullScreenApi.cancelFullScreen = function(el) {
    return (this.prefix === '') ? document.cancelFullScreen() : document[this.prefix + 'CancelFullScreen']();
    }       
}

// jQuery plugin
if (typeof jQuery != 'undefined') {
    jQuery.fn.requestFullScreen = function() {

    return this.each(function() {
    var el = jQuery(this);
    if (fullScreenApi.supportsFullScreen) {
    fullScreenApi.requestFullScreen(el);

    }
    });
    };
}
if (typeof jQuery != 'undefined') {
    jQuery.fn.mozRequestFullScreen = function() {

    return this.each(function() {
    var el = jQuery(this);
    if (fullScreenApi.supportsFullScreen) {
    fullScreenApi.requestFullScreen(el);

    }
    });
    };
}
if (typeof jQuery != 'undefined') {
    jQuery.fn.mozRequestFullScreen = function() {

    return this.each(function() {
    var el = jQuery(this);
    if (fullScreenApi.supportsFullScreen) {
    fullScreenApi.mozRequestFullScreen(el);

    }
    });
    };
}
if (typeof jQuery != 'undefined') {
    jQuery.fn.mozCancelFullScreen = function() {

    return this.each(function() {
    var el = jQuery(this);
    if (fullScreenApi.cancelFullScreen) {
    fullScreenApi.mozCancelFullScreen(el);

    }
    });
    };
}

// export api
window.fullScreenApi = fullScreenApi;   
})();

var fsButton = document.getElementById('fsbutton');
if (window.fullScreenApi.supportsFullScreen) {
    //fsStatus.innerHTML = 'YES: Your browser supports FullScreen';
    //fsStatus.className = 'fullScreenSupported';

    // handle button click
    fsButton.addEventListener('click', function() {
    console.log("Browser Supports fullscreen");
    document.getElementById('exitscreen').style.display='block';
    document.getElementById('fullscreen').style.display='none';
    //window.fullScreenApi.requestFullScreen(fsElement);
    window.fullScreenApi.requestFullScreen(document.documentElement);

    }, true);
} else {

    console.log ("SORRY: Your browser does not support FullScreen");
}
var cfullscreen = document.getElementById('cfullscreen');
if (window.fullScreenApi.supportsFullScreen) {
    //fsStatus.innerHTML = 'YES: Your browser supports FullScreen';
    //fsStatus.className = 'fullScreenSupported';

    // handle button click
    cfullscreen.addEventListener('click', function() {
        //console.log("Exit fullscreen");
        document.getElementById('exitscreen').style.display='none';
        document.getElementById('fullscreen').style.display='block';
        //window.fullScreenApi.requestFullScreen(fsElement);
        window.fullScreenApi.cancelFullScreen(document.documentElement);

    }, true);

    document.documentElement.addEventListener(fullScreenApi.fullScreenEventName, function() {
    if (fullScreenApi.isFullScreen()) {
        document.getElementById('exitscreen').style.display='block';
        document.getElementById('fullscreen').style.display='none';
        console.log("Whoa, you went fullscreen");
    } else {
        console.log("Back to normal");
        document.getElementById('fullscreen').style.display='block';
        document.getElementById('exitscreen').style.display='none';
    }
}, true);

} else {

    console.log ("SORRY: Your browser does not support FullScreen");
}
<div id="exitscreen" style="display:none;"><a href="#">
<img src="https://cdn1.iconfinder.com/data/icons/Icon_for_MealKeeper__s_soft_by_shlyapnikova/full%20screen_16.png" id="cfullscreen"/></a></div>

/* 
本机全屏JavaScript API
-------------
目前假定采用Mozilla命名约定而不是W3C
*/
(功能(){
var fullScreenApi={
supportsFullScreen:错误,
isFullScreen:函数(){return false;},
requestFullScreen:函数(){},
取消全屏:函数(){},
fullscreenEnabled:函数(){},
fullScreenEventName:“”,
前缀:“”
},
浏览器前缀='webkit moz o ms khtml'.split('');
//检查本机支持
if(typeof document.cancelFullScreen!=“未定义”){
fullScreenApi.supportsFullScreen=true;
}否则{
//按供应商前缀检查全屏支持
for(var i=0,il=browserPrefixes.length;i

<div id="exitscreen" style="display:none;"><a href="#">
<img src="https://cdn1.iconfinder.com/data/icons/Icon_for_MealKeeper__s_soft_by_shlyapnikova/full%20screen_16.png" id="cfullscreen"/></a></div>
html代码

<div id="exitscreen" style="display:none;"><a href="#">
<img src="https://cdn1.iconfinder.com/data/icons/Icon_for_MealKeeper__s_soft_by_shlyapnikova/full%20screen_16.png" id="cfullscreen"/></a></div>