Solved

True Window Focus

Posted on 1997-12-19
5
201 Views
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?
0
Comment
Question by:idiot111497
5 Comments
 
LVL 6

Accepted Solution

by:
tecbuilder earned 200 total points
Comment Utility
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.
0
 
LVL 7

Expert Comment

by:RBertora
Comment Utility
What a useless answer!
Has anything changed since 97?

annoyed.
Rob;-)
0
 
LVL 1

Expert Comment

by:Astroman
Comment Utility
I gotta agree with Rob. Not worth 20 points. Maybe PAQ's should devalue over time...
0
 

Expert Comment

by:rchism
Comment Utility
I agree with Rob and Astroman.  I've been ripped off!
0
 
LVL 7

Expert Comment

by:RBertora
Comment Utility
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..


Rob.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now