简体   繁体   English

mozRequestFullScreen(); 不工作 为什么?

[英]mozRequestFullScreen(); not working. Why?

I have: 我有:

function doit()
{
    document.getElementById('id1').mozRequestFullScreen();
}

But it doesn't work. 但它不起作用。 Though it does for this site : 虽然它适用于本网站

jsFiddle here . jsFiddle 在这里

Why? 为什么? (I'm using FireFox.) (我正在使用FireFox。)

JSFiddle results are displayed within an iframe. JSFiddle结果显示在iframe中。 Unless this frame explicitly allows fullscreen by adding the mozallowfullscreen attribute it will silently fail: 除非此框架通过添加mozallowfullscreen属性明确允许全屏,否则它将无声地失败:

https://developer.mozilla.org/en-US/docs/HTML/Element/iframe#attr-mozallowfullscreen https://developer.mozilla.org/en-US/docs/HTML/Element/iframe#attr-mozallowfullscreen

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM