By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,501 Members | 1,678 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,501 IT Pros & Developers. It's quick & easy.

How to child window always ontop

P: n/a
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!
Jul 23 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Cortes" <tv*********@yahoo.com> schrieb im Newsbeitrag
news:40******@duster.adelaide.on.net...
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
Jul 23 '05 #2

P: n/a
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!
Jul 23 '05 #3

P: n/a
> 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/a...lessdialog.asp

And play with it here:
http://msdn.microsoft.com/workshop/s...lessDialog.htm

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

Good luck,
Vincent
Jul 23 '05 #4

P: n/a
DU
Cortes wrote:
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
Jul 23 '05 #5

P: n/a
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

DU <dr*******@hotWIPETHISmail.com> wrote in message news:<ca**********@news.eusc.inter.net>...
Cortes wrote:
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!

Jul 23 '05 #6

P: n/a
"Kien" <ca*********@hotmail.com> schrieb im Newsbeitrag
news:16**************************@posting.google.c om...
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
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.