javascript设置iframe里子窗口全屏

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>子窗口全屏</title>
</head>
<body>
    <input id="windowFullScreen" type="button" value="全屏" />
<script>
    window.onload=function(){
        document.getElementById("windowFullScreen").onclick=function(){
            /*设置重新打开的页面
            * toolbar 不显示浏览器的工具栏
            * location 不显示地址字段
            * menubar 不显示菜单栏
            * directories 不显示目录添加按钮
            * scrollbars 窗体中内部超出窗口可视范围时不存在滚动条
            * */
            var win=window.open("child.html","_blank","resizable=yes;status=yes;toolbar=no;location=no;menubar=no;directories=no;scrollbars=no;");
            win.moveTo(0,0);
            win.resizeTo(screen.availWidth,screen.availHeight);//设置新打开窗口的宽、高
        }
    }
</script>
</body>
</html>

你可能感兴趣的:(javascript设置iframe里子窗口全屏)