Link在新标签中打开和重点previous标签 [英] Link open in new tab and focus on previous tab

查看:452
本文介绍了Link在新标签中打开和重点previous标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让焦点仍然是相同的标签上,而的链接在新标签页在后台虽然jQuery的?打开

How to make the focus remains on the same tab while a link is opening in new tab in the background though jquery ?

推荐答案

试试这个code -

Try this code -

   <p>Click the button to open a new window, and assure that the new window GETS focus (send the new window to the front).</p>
   <button onclick="myFunction()">Try it</button>
   <script>
      function myFunction() {
        var myWindow = window.open("", "", "width=200,height=100");
        myWindow.document.write("<p>A new window!</p>");
        myWindow.focus();
      }
   </script>

这篇关于Link在新标签中打开和重点previous标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆