从全屏退出不工作? [英] Exit from full screen not working?

查看:145
本文介绍了从全屏退出不工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个以全屏模式工作的应用程序。
我正在使用Iframe去全屏。问题是如何关闭按钮点击全屏?



我使用这个代码:



<$ p $函数exitfs(){
if(document.cancelFullScreen){
document.cancelFullScreen();
} else if(document.mozCancelFullScreen){
document.mozCancelFullScreen();
} else if(document.webkitCancelFullScreen){
document.webkitCancelFullScreen();




$ b如果我通过萤火虫控制台运行,不能用点击事件绑定?

  function fullscreen(keys){
var f = e('newIfrane' );
if(keys){
if(f.mozRequestFullScreen){
f.mozRequestFullScreenWithKeys();
} else if(f.webkitRequestFullScreen){
f.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if(f.mozRequestFullScreen){
f.mozRequestFullScreen();
} else if(f.webkitRequestFullScreen){
f.webkitRequestFullScreen();


$ b code
$ b $ p $调用这个函数就像 fullscreen(false);



注意:Iframe正以全屏模式加载相同的页面。
在Page中有一个图像点击的图像我打电话 exitfs()

我没有得到问题是什么?
Thanks ...

解决方案

正如 Passerby c $ c> parent.exitfs(); 它为我工作。希望能帮到一些...

I'm working on a application which works in full screen mode. I'm using a Iframe to go to fullscreen. the problem is how to close that fullscreen on button click?

I'm using this code:

function exitfs(){
    if (document.cancelFullScreen) {
        document.cancelFullScreen();
    } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
    } else if (document.webkitCancelFullScreen) {
        document.webkitCancelFullScreen();
    }
} 

It works fine if i run it through firebug console but not works when bind with click event?

 function fullscreen(keys) {
    var f = e('newIfrane');
    if (keys) {
        if (f.mozRequestFullScreen) {
            f.mozRequestFullScreenWithKeys();
        } else if (f.webkitRequestFullScreen) {
            f.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
        }
    } else {
        if (f.mozRequestFullScreen) {
            f.mozRequestFullScreen();
        } else if (f.webkitRequestFullScreen) {
            f.webkitRequestFullScreen();
        }
    }
}

calling this function like fullscreen(false);

Note: Iframe is loading the same page in fullscreen mode. In Page there is a Image on click of that image I'm calling exitfs().

I'm not getting what is the problem? Thanks...

解决方案

as suggested by Passerby I tried with the parent.exitfs(); and it worked for me. hope it will help someOne...

这篇关于从全屏退出不工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆