Keep focus on the main page

Asked

Viewed 126 times

1

I have a page being my main screen, when selecting a value and clicking the button it will call another page referring to which I chose, the same opens in the form of Popup.

I need this Popup to open without the focus on it, that the focus stays on this main screen, because the system works with two screens and when I lose the focus of the main need to be clicking back if you want to perform the operations.

I read about the focus(); but I couldn’t find anything that would help me with the page, I was able to do it in several aspects, applying inputs, Uttons and links, but what I need is the focus on the whole page.

I also found that there are problems related to my own document $(document).ready(function() {

I’m posting to see if I can get an idea of how to do this process.

  • Why in Popup you don’t create an event that throws focus back to Parent page using an anchored link? Type href=".. /pg-parent.html#anchors"

  • Hello, I’m liking your idea, but I don’t quite understand how it works.. If I call an iink it won’t just reopen the page? I haven’t tried yet because at the moment I can’t, but I will focus on this idea yes.

  • and in case it will also be necessary to create a $(Document). ready(Function() { for my Popup right?! With this function you said?

  • That’s the idea. I don’t know much about JS, but from what I see, I think it’s possible. At the end of the Popup load you redirect with a link to the "anchor" of the parent page.

  • All right, I’m off work now, I’m gonna try to do something about it. When I’m done I’ll give you an answer.

  • I really tried N ways and I can’t, the most it does is redirect inside the popup itself.. See if this is what you really imagined: window.location.href=".. /.. /Panel.html#ancora" (this is in a js that is called next to the popup)

  • Alexandre like I told you, I’m not the JS rss guy.. Try to edit your question with what you have of JS, or create a new question with this JS and its problem.

Show 2 more comments

2 answers

1

Just use the Html5 attribute target

<a href="https://www.w3schools.com" target="_blank">Sem mudar o foco</a><br>

<a href="https://www.w3schools.com" target="_blank">Mudar o foco</a>

  • Thanks for the contribution, but this case did not solve, the Blank makes open in a new guide, show. This procedure I got with the popup the question is, it opens on another page but I need the focus to stay on the previous, that it opens in the background.

1


Good morning dear(as), I thank those who participated giving an idea or even presenting codes, through programming was more difficult than I thought and none of the ideas worked. I searched several forums and tried various types of programming. In answer to my question, when testing by Firefox browser I realized that it is working, because in firefox who gets the focus is the main page and not the popup.

This is probably browser configuration, so if anyone knows how to change the Chrome configuration so that the popup is in the background, thank you.

In addition, the solution is in the browser, in my case it was solved with firefox.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.