0
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;

这是打开窗口的代码。如果我想全屏打开怎么办

4

1 回答 1

2
<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> 

要加载的页面中的类似内容。通常认为在没有通知的情况下调整浏览器大小是不好的做法。

您可能想阅读https://developer.mozilla.org/en-US/docs/Web/Guide/DOM/Using_full_screen_mode全屏 api 指南。

于 2013-07-14T10:37:43.757 回答