Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more


True Window Focus

Posted on 1997-12-19
Medium Priority
Last Modified: 2012-08-13
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?
Question by:idiot111497
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

tecbuilder earned 800 total points
ID: 1276996
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 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.

Expert Comment

ID: 2653572
What a useless answer!
Has anything changed since 97?


Expert Comment

ID: 3091336
I gotta agree with Rob. Not worth 20 points. Maybe PAQ's should devalue over time...

Expert Comment

ID: 5013139
I agree with Rob and Astroman.  I've been ripped off!

Expert Comment

ID: 5021641
I was thinking of a hack:

kick off a timer just before
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..


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question