Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/386.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 如何允许在Iframe中使用全屏模式_Javascript_Html_Iframe - Fatal编程技术网

Javascript 如何允许在Iframe中使用全屏模式

Javascript 如何允许在Iframe中使用全屏模式,javascript,html,iframe,Javascript,Html,Iframe,我正在使用以下js创建iframe: parent.html <script type="text/javascript"> var ifrm = document.createElement("iframe"); ifrm.setAttribute("src", "demo.html"); ifrm.setAttribute("id", "retNotif;"); ifrm.style.width = "540px"; ifrm.style.height = "200px"; if

我正在使用以下js创建iframe:

parent.html

<script type="text/javascript">
var ifrm = document.createElement("iframe");
ifrm.setAttribute("src", "demo.html");
ifrm.setAttribute("id", "retNotif;");
ifrm.style.width = "540px";
ifrm.style.height = "200px";
ifrm.style.minHeight = "100px";
ifrm.style.position = "fixed";
ifrm.style.bottom = "150px";
ifrm.style.left = "0px";
ifrm.style.backgroundColor = "transparent";
ifrm.style.zIndex = "9999";
ifrm.frameBorder = "0";
ifrm.allowTransparency = "true";
document.body.appendChild(ifrm);
</script>

var ifrm=document.createElement(“iframe”);
setAttribute(“src”、“demo.html”);
setAttribute(“id”、“retNotif;”);
ifrm.style.width=“540px”;
ifrm.style.height=“200px”;
ifrm.style.minHeight=“100px”;
ifrm.style.position=“固定”;
ifrm.style.bottom=“150px”;
ifrm.style.left=“0px”;
ifrm.style.backgroundColor=“透明”;
ifrm.style.zIndex=“9999”;
ifrm.frameBorder=“0”;
ifrm.allowTransparency=“true”;
文件.body.appendChild(ifrm);
在iframe(demo.html)中:我有一个正常的引导模型

我想在iframe全屏上显示模型如何操作


window.onload=function(){
var ifrm=document.createElement(“iframe”);
setAttribute(“src”、“demo.html”);
setAttribute(“id”、“retNotif;”);
ifrm.style.width=“100vw”;
ifrm.style.height=“100vh”;
ifrm.style.minHeight=“100px”;
ifrm.style.position=“固定”;
ifrm.style.top=“0”;
ifrm.style.left=“0”;
ifrm.style.backgroundColor=“透明”;
ifrm.style.zIndex=“9999”;
ifrm.frameBorder=“0”;
ifrm.allowTransparency=“true”;
文件.body.appendChild(ifrm);
}
左上角的固定iframe具有100%的宽度和高度

<script type="text/javascript">
  window.onload=function(){
    var ifrm = document.createElement("iframe");
    ifrm.setAttribute("src", "demo.html");
    ifrm.setAttribute("id", "retNotif;");
    ifrm.style.width = "100vw";
    ifrm.style.height = "100vh";
    ifrm.style.minHeight = "100px";
    ifrm.style.position = "fixed";
    ifrm.style.top = "0";
    ifrm.style.left = "0";
    ifrm.style.backgroundColor = "transparent";
    ifrm.style.zIndex = "9999";
    ifrm.frameBorder = "0";
    ifrm.allowTransparency = "true";
    document.body.appendChild(ifrm);
  }
</script>