How to child window always ontop

C

Cortes

Hi all,

I have this parent window poping up the child window. SOmething like this

popupWinA= window.open("child.html","popupWinA"," width=300 , height=150)

I want this child popupWinA always stay on top of the parent window no
matter where the focus is (so that when you click the parent, the child
doesn't *disappear* because if its small size).

Is there any way to do this?
any reply will be greatly appreciated. Thanks

Wish you all have a good day!
 
M

Markus Ernst

Cortes said:
Hi all,

I have this parent window poping up the child window. SOmething like this

popupWinA= window.open("child.html","popupWinA"," width=300 , height=150)

I want this child popupWinA always stay on top of the parent window no
matter where the focus is (so that when you click the parent, the child
doesn't *disappear* because if its small size).

Is there any way to do this?

I don't think so. You can add onBlur="self.focus()" to the small window's
document's body tag, but of course the parent window will loose focus then.
If the information in the small window has to be always visible you will
have to redesign your site and include that information in the parent's
documents. Like that you also avoid all popup-related problems.

For a lot of cases the task is not actually that the popup stays visible but
that it should regain focus when reloaded (i.e. for slide shows or
whatever). You can achieve that with onLoad="self.focus()", or by closing it
when it gets behind the parent window (onBlur="self.close()").

If you are a frequent newsgroup user you know of course that the best way is
avoiding popups at all.

HTH
Markus
 
C

Cortes

Thanks Markus, much appreciated!

My popup is something like the finder popup in Microsoft Internet Explorer.
So it had better stay visible all the time.

I just found out in Netscape 4.0 you have something like

popup=window.open("child.html","child", alwaysRaised= yes);

which will make the child always floats ontop no matter if it is active or
not.

However, Microsoft IE doesn't support it :(. I don't know if there is a
workaround?

I wish you all a very good day!
 
V

Vincent van Beveren

which will make the child always floats ontop no matter if it is
active or not.

However, Microsoft IE doesn't support it :(. I don't know if there is
a workaround?

What you are looking for is the following:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/showmodelessdialog.asp

And play with it here:
http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModelessDialog.htm

Though only supported by MS ofcourse :) but I'm sure there are solutions
for mozilla.

Good luck,
Vincent
 
D

DU

Cortes said:
Hi all,

I have this parent window poping up the child window. SOmething like this

popupWinA= window.open("child.html","popupWinA"," width=300 , height=150)

I want this child popupWinA always stay on top of the parent window no
matter where the focus is (so that when you click the parent, the child
doesn't *disappear* because if its small size).

Is there any way to do this?
any reply will be greatly appreciated. Thanks

Wish you all have a good day!

1- The 3rd argument in the window.open call is a string (between a pair
of quotes) without any blank space in it, otherwise, NS 6+ and
Mozilla-based browsers will not comply with the specifications requested
in the windowFeatures list.

2- alwaysRaised requires enhanced security privileges in NS 4, NS 6+ and
Mozilla-based browsers

3- I strongly advised against onblur="self.focus();" which will confuse
users and abuse their system resources. I'm absolutely convinced there
can be a better way, a more user-friendly way to achieve what you want
if only you would elaborate on your webpage design goals, requirements.

Modal solutions (like showModalDialog and showModelessDialog) are
extreme solutions which, when improperly, unjustifiably used, often
alienate users than anything. At the very least, you should always give
some kind of veto power to your users if they want to turn off your
"finder popup". Be aware that power Mozilla users will know how to
neutralize an inflexible modal popup while others can always use the
back button or the close window button of their browser on your site.

DU
 
K

Kien

Hi,
All other posts have correctly advised you about the use and abuse of pop-ups.
I would suggest a back on top interval.

<body onload='setInterval("self.focus()",1500);'>

Hopefully this would pop the pop up back every 1.5 secs or so
if it happens to lose focus.

Kien
 
M

Markus Ernst

Kien said:
Hi,
All other posts have correctly advised you about the use and abuse of pop-ups.
I would suggest a back on top interval.

<body onload='setInterval("self.focus()",1500);'>

Hopefully this would pop the pop up back every 1.5 secs or so
if it happens to lose focus.

Huh... imagine the user is actually scrolling, reading some text, or filling
in a form at the moment the popup is coming back to the top... there are
less things on the web that are more confusing than unexpectedly opened
windows.

Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top