窗口的参数是什么?开放的接受

What parameters does window.open accept?

本文关键字:参数 是什么 窗口      更新时间:2023-09-26

如何在window.open()呼叫中添加以下参数?我不知道该怎么命名。

*I don't want a toolbar
*I don't want a menu bar
*I don't want a status bar
*I want a scrollbar
*I don't want the user to be able to resize

下面是我当前打开窗口的代码:

    <head>
    <script type="text/javascript">
    function OLA(url) 
    {
      params  = 'width=290';
      params += ', height='+(parseInt(screen.availHeight) * .9355);
      params += ', top=0, left=0';
      params += ', fullscreen=no';
      newwin=window.open(url,'windowname4', params);
      if (window.focus) {newwin.focus()}
      return false;
    }
    </script>
    </head>
    <body>
    <a href="javascript: void(0)" onclick="OLA('ANO_1_InitialAssessment.html')">Start Here</a>
    </body>

对于这些参数,您可以添加到您的字符串:

toolbar=off     //I don't want a toolbar
resizable=off   //I don't want the user to be able to resize
menu=off        //I don't want a menu bar
status=off      //I don't want a status bar
scrollbars=on   //I want a scrollbar

我建议检查MDN文档上的window.open页面,它将列出所有参数,以及它们的支持。

注意:并不是所有的参数在所有浏览器上都以相同的方式工作