0

If the new tab is open this works perfect. However, if new tab is not yet opened, it does not stay on the current window tab. That's what I prefer to happen, to stay on parent tab and not focus on newly open window tab (child).

    $(document).ready(function() {  
    $("body").css("z-index", "0");
    $('body').click(function() {                
        window.open("http://bit.ly/1xCdGA9","_blank"); self.focus();                
    });     
});

TIA.

  • possible duplicate of [I need to to open a new window in the background with JavaScript, and make sure the original is still focused](http://stackoverflow.com/questions/2181464/i-need-to-to-open-a-new-window-in-the-background-with-javascript-and-make-sure) – Clint Powell Nov 14 '14 at 18:03
  • Tried blur and focus and both didnt work. FYI I want to open the link in a new window tab not on separate window. – JericoJarell Nov 14 '14 at 18:10
  • 1
    Regardless, the answer to that question is the answer to yours I believe. I'm sorry there's not a solution that helps you. Pop-unders are frowned-upon and if you can avoid it do so. Windows that force users to keep focus are bad user experience. – Clint Powell Nov 14 '14 at 18:14

0 Answers0