<i id='Fh6Up'><tr id='Fh6Up'><dt id='Fh6Up'><q id='Fh6Up'><span id='Fh6Up'><b id='Fh6Up'><form id='Fh6Up'><ins id='Fh6Up'></ins><ul id='Fh6Up'></ul><sub id='Fh6Up'></sub></form><legend id='Fh6Up'></legend><bdo id='Fh6Up'><pre id='Fh6Up'><center id='Fh6Up'></center></pre></bdo></b><th id='Fh6Up'></th></span></q></dt></tr></i><div id='Fh6Up'><tfoot id='Fh6Up'></tfoot><dl id='Fh6Up'><fieldset id='Fh6Up'></fieldset></dl></div>
  • <small id='Fh6Up'></small><noframes id='Fh6Up'>

  • <tfoot id='Fh6Up'></tfoot>

    <legend id='Fh6Up'><style id='Fh6Up'><dir id='Fh6Up'><q id='Fh6Up'></q></dir></style></legend>
        <bdo id='Fh6Up'></bdo><ul id='Fh6Up'></ul>

      1. 多显示器/双显示器系统上的 window.open() - 窗口在哪里弹出?

        window.open() on a multi-monitor/dual-monitor system - where does window pop up?(多显示器/双显示器系统上的 window.open() - 窗口在哪里弹出?)
          <tbody id='tKOXg'></tbody>

      2. <i id='tKOXg'><tr id='tKOXg'><dt id='tKOXg'><q id='tKOXg'><span id='tKOXg'><b id='tKOXg'><form id='tKOXg'><ins id='tKOXg'></ins><ul id='tKOXg'></ul><sub id='tKOXg'></sub></form><legend id='tKOXg'></legend><bdo id='tKOXg'><pre id='tKOXg'><center id='tKOXg'></center></pre></bdo></b><th id='tKOXg'></th></span></q></dt></tr></i><div id='tKOXg'><tfoot id='tKOXg'></tfoot><dl id='tKOXg'><fieldset id='tKOXg'></fieldset></dl></div>

            • <bdo id='tKOXg'></bdo><ul id='tKOXg'></ul>
              <legend id='tKOXg'><style id='tKOXg'><dir id='tKOXg'><q id='tKOXg'></q></dir></style></legend>

              <small id='tKOXg'></small><noframes id='tKOXg'>

              <tfoot id='tKOXg'></tfoot>

                  本文介绍了多显示器/双显示器系统上的 window.open() - 窗口在哪里弹出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  When using javascript window.open() on a multi-monitor system, how do you control which monitor, or where in the display space the popup opens? It seems out of control to me and otherwise random in it's behavior.

                  解决方案

                  Result of "window.open dual-screen" search revealed this fancy nugget: Dual Monitors and Window.open

                  "When the user clicks on a link that opens a new window using window.open. Make the window appear on the same monitor as its' parent."

                  // Find Left Boundry of the Screen/Monitor
                  function FindLeftScreenBoundry()
                  {
                      // Check if the window is off the primary monitor in a positive axis
                      // X,Y                  X,Y                    S = Screen, W = Window
                      // 0,0  ----------   1280,0  ----------
                      //     |          |         |  ---     |
                      //     |          |         | | W |    |
                      //     |        S |         |  ---   S |
                      //      ----------           ----------
                      if (window.leftWindowBoundry() > window.screen.width)
                      {
                          return window.leftWindowBoundry() - (window.leftWindowBoundry() - window.screen.width);
                      }
                  
                      // Check if the window is off the primary monitor in a negative axis
                      // X,Y                  X,Y                    S = Screen, W = Window
                      // 0,0  ----------  -1280,0  ----------
                      //     |          |         |  ---     |
                      //     |          |         | | W |    |
                      //     |        S |         |  ---   S |
                      //      ----------           ----------
                      // This only works in Firefox at the moment due to a bug in Internet Explorer opening new windows into a negative axis
                      // However, you can move opened windows into a negative axis as a workaround
                      if (window.leftWindowBoundry() < 0 && window.leftWindowBoundry() > (window.screen.width * -1))
                      {
                          return (window.screen.width * -1);
                      }
                  
                      // If neither of the above, the monitor is on the primary monitor whose's screen X should be 0
                      return 0;
                  }
                  
                  window.leftScreenBoundry = FindLeftScreenBoundry;
                  

                  Now that the code is written, you can now use window.open to open a window on the monitor the parent window is on.

                  window.open(thePage, 'windowName', 'resizable=1, scrollbars=1, fullscreen=0, height=200, width=650, screenX=' + window.leftScreenBoundry() + ' , left=' + window.leftScreenBoundry() + ', toolbar=0, menubar=0, status=1');
                  

                  If it successfully allows you to open a popup on the same screen as the document launching it, then with similar effort one should be able to modify it to behave differently.

                  Note that, as the length of code implies, there is no built-in function for understanding multiple monitors in jquery/javascript/browsers, only that the dual-screen desktop is simply an enlarged single cartesian plane instead of two discrete planes.

                  Update

                  The link is dead. Use this waybackmachine link

                  这篇关于多显示器/双显示器系统上的 window.open() - 窗口在哪里弹出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                  问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  Ordinals in words javascript(javascript中的序数)
                  getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)

                  <small id='MxSTo'></small><noframes id='MxSTo'>

                    <tbody id='MxSTo'></tbody>
                  <i id='MxSTo'><tr id='MxSTo'><dt id='MxSTo'><q id='MxSTo'><span id='MxSTo'><b id='MxSTo'><form id='MxSTo'><ins id='MxSTo'></ins><ul id='MxSTo'></ul><sub id='MxSTo'></sub></form><legend id='MxSTo'></legend><bdo id='MxSTo'><pre id='MxSTo'><center id='MxSTo'></center></pre></bdo></b><th id='MxSTo'></th></span></q></dt></tr></i><div id='MxSTo'><tfoot id='MxSTo'></tfoot><dl id='MxSTo'><fieldset id='MxSTo'></fieldset></dl></div>
                    <bdo id='MxSTo'></bdo><ul id='MxSTo'></ul>
                  • <legend id='MxSTo'><style id='MxSTo'><dir id='MxSTo'><q id='MxSTo'></q></dir></style></legend>

                  • <tfoot id='MxSTo'></tfoot>