如何使用javascript打开窗口全屏

如何使用javascript打开窗口全屏,javascript,Javascript,这是打开窗口的代码。如果我想全屏打开它怎么办 var windowprops = "width=1024,height=768,location=yes,toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,top=1,left=1"; var url = "http://silverslady.net/silver/silverbrazil.php?mn=5343"; var myWin = window.open(ur

这是打开窗口的代码。如果我想全屏打开它怎么办
var windowprops = "width=1024,height=768,location=yes,toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,top=1,left=1";
var url = "http://silverslady.net/silver/silverbrazil.php?mn=5343";
var myWin = window.open(url, '', windowprops);
myWin.blur();
window.focus();
return true;
window.onload=maxWindow; 函数maxWindow(){ window.moveTo(0,0); 如果(全部文件){ top.window.resizeTo(screen.availWidth,screen.availHeight); } else if(document.layers | | document.getElementById){ if(top.window.outerHeight 在要加载的页面中显示类似的内容。通常认为,在没有通知的情况下调整浏览器的大小是不好的做法


您可能需要阅读本全屏api指南。

尝试将全屏=是添加到windowprops中
<script type="text/javascript">
    window.onload = maxWindow;
    function maxWindow() {
        window.moveTo(0, 0);
        if (document.all) {
            top.window.resizeTo(screen.availWidth, screen.availHeight);
        }

        else if (document.layers || document.getElementById) {
            if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
                top.window.outerHeight = screen.availHeight;
                top.window.outerWidth = screen.availWidth;
            }
        }
    }
</script>