<tfoot id='ofbFJ'></tfoot>

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

    1. <small id='ofbFJ'></small><noframes id='ofbFJ'>

    2. <legend id='ofbFJ'><style id='ofbFJ'><dir id='ofbFJ'><q id='ofbFJ'></q></dir></style></legend>

          <bdo id='ofbFJ'></bdo><ul id='ofbFJ'></ul>

        使用此 javascript 在屏幕中心打开新窗口?

        Open new window on center of screen with this javascript?(使用此 javascript 在屏幕中心打开新窗口?)

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

          <tbody id='vrehO'></tbody>

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

              <tfoot id='vrehO'></tfoot>

                  <legend id='vrehO'><style id='vrehO'><dir id='vrehO'><q id='vrehO'></q></dir></style></legend>

                1. 本文介绍了使用此 javascript 在屏幕中心打开新窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的 javascript 经验非常有限.我想在屏幕中央打开新窗口.

                  My experience with javascript is extraordinarily limited. I would like to have the new window open up in the center of the screen.

                  <script type="text/javascript">
                  function fbs_click() {
                  var twtTitle = document.title;
                  var twtUrl = location.href;
                  var maxLength = 140 - (twtUrl.length + 1);
                  if (twtTitle.length > maxLength) {
                      twtTitle = twtTitle.substr(0, (maxLength - 3)) + '...';
                  }
                  var twtLink = 'http://twitter.com/home?status=' + encodeURIComponent(twtTitle + ' ' + twtUrl);
                  window.open(twtLink,'','width=300,height=300'); } </script>
                  

                  如果有人可以请更新我的代码以完成一个居中的弹出窗口,那将是惊人的!

                  If somebody can please update my code to accomplish a popup window which is centered that would be amazing!

                  推荐答案

                  怎么样(改编自这里):

                  function MyPopUpWin(url, width, height) {
                      var leftPosition, topPosition;
                      //Allow for borders.
                      leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
                      //Allow for title and status bars.
                      topPosition = (window.screen.height / 2) - ((height / 2) + 50);
                      //Open the window.
                      window.open(url, "Window2",
                      "status=no,height=" + height + ",width=" + width + ",resizable=yes,left="
                      + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY="
                      + topPosition + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no");
                  }
                  

                  通过将代码中的 window.open(twtLink,'','width=300,height=300'); 替换为 MyPopUpWin(twtLink, 300, 300); 来调用它

                  Call it by replacing window.open(twtLink,'','width=300,height=300'); in your code with MyPopUpWin(twtLink, 300, 300);

                  这篇关于使用此 javascript 在屏幕中心打开新窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Fetch multiple links inside foreach loop(在 foreach 循环中获取多个链接)
                  Backbone Fetch Request is OPTIONS method(Backbone Fetch Request 是 OPTIONS 方法)
                  Fetch API leaks memory in Chrome(Fetch API 在 Chrome 中泄漏内存)
                  How can I download and save a file using the Fetch API? (Node.js)(如何使用 Fetch API 下载和保存文件?(Node.js))
                  Send blob data to node using fetch, multer, express(使用 fetch、multer、express 将 blob 数据发送到节点)
                  Sending a custom User-Agent string along with my headers (fetch)(发送自定义用户代理字符串以及我的标头(获取))

                    <legend id='ISVVu'><style id='ISVVu'><dir id='ISVVu'><q id='ISVVu'></q></dir></style></legend><tfoot id='ISVVu'></tfoot>
                      <bdo id='ISVVu'></bdo><ul id='ISVVu'></ul>
                      • <small id='ISVVu'></small><noframes id='ISVVu'>

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