Javascript 如何允许在Iframe中使用全屏模式
我正在使用以下js创建iframe: parent.htmlJavascript 如何允许在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
<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>