• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 247
  • Last Modified:

True Window Focus

This is a problem I've sent around the javascript newsgroup(s) a number of items. Nobody seems to have quite gotten it yet.

After having a parent window open a child window, I am now trying to have that child window stay focused on top. The reason for this is I am using the new window as a navigation system. When a user clicks on places in the new window, it changes screens in the parent frames. The problem is that when a user clicks in the parent frame or anywhere else, they lose the focus of the child window. That's no big deal for people who are familiar with windows and browser operation. You just click in the task bar to get your window back. But for those who are unfamiliar computer users, it's really annoying to try to bring back the window.

I tried a few crazy ideas like "onblur=window.focus()" but that takes total control. The window stays on top, but it denies access to any other windows (including other programs) except for itself.

I recognize that the above is simply the way nearly ALL windows work in Win95 and other operating systems. However, this hasn't always been the case with good GUI design.

Anyone have any suggestions on how to make this work?
1 Solution
You could tell everyone to upgrade the screens to a 21" monitor.  Just kidding.  What you are wanting is a an always-on-top feature for the child window where it won't retain the focus, but it will stay above all other windows.  Unfortunately, browser windows that are created via the windows.open function don't have this property.  That's probabely why no one responded in the newsgroup.  The GUI design which you mentioned is built into the program via Windows API functions.  Most of the API functions have been worked into objects so the average programmer doesn't need to know what API is called, they just need to know what object to use to keep the window on top.

You can do some work around type of things, but it sounds like you have tried everything.  My only suggestion would be to incorporate the childWindow.focus() on all of your links within the parent and include a link in the parent that will bring the child back on top.
What a useless answer!
Has anything changed since 97?

I gotta agree with Rob. Not worth 20 points. Maybe PAQ's should devalue over time...
I agree with Rob and Astroman.  I've been ripped off!
I was thinking of a hack:

kick off a timer just before window.open
ontimer run a window.focus

within that the child window
run opener.timer.stop command
just before closing....

It would take me some time to produce the actual code, but if someone is willing to create a new question for this then I could be persuaded to code it..

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now