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

need a popup window to be always in focus

P: n/a
Hi,

first I must admit this is one of the most active group I have ever seen.

For my question: is it possible to create a small popup window that remain
in focus until it is closed. That is, even if you click on the main (caller)
window just beside the popup, the popup would remain in focus. I've tried
"alwaysRaised" with window.open() function but it doesn't work, must be for
something else!!!

Thanks!
Moist
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Moist wrote:
For my question: is it possible to create a small popup window that remain
in focus until it is closed.


Unfortunately you cannot do that correctly in a cross-browser way (not
even mentioning popup-blockers); usual approaches used blur events on
the popup (if it's blurred, then focus it, but beware not to steal the
focus from a popup element), but I believe them to be unreliable at best.

If you're concerned with IE only (e.g. for an intranet), then have a
look at the showModalDialog method, which does exactly what you're
looking for.

<URL:http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/showmodaldialog.asp>

Alternate approaches to popups include so-called "in-window" popups,
which are DIV-based and therefore modeless; making them modal might also
be doable, but without an acceptable fallback I'm afraid.

<URL:http://www.litotes.demon.co.uk/js_info/pop_ups.html>

All in all, if you're targeting a web environment with unknown user
agents, I'd strongly encourage you to re-design the part of your
application requiring a popup to avoid the usage of popups; that would
save you further problems in the future.
HTH,
Yep.
Jul 23 '05 #2

P: n/a
It is indeed for a small Intranet, it will be used as an entry form.
The "showModalDialog" is perfect.

Thanks!
Moist

"Yann-Erwan Perio" <y-*******@em-lyon.com> a écrit dans le message de
news:41***********************@news.free.fr...
Moist wrote:
For my question: is it possible to create a small popup window that remain in focus until it is closed.
Unfortunately you cannot do that correctly in a cross-browser way (not
even mentioning popup-blockers); usual approaches used blur events on
the popup (if it's blurred, then focus it, but beware not to steal the
focus from a popup element), but I believe them to be unreliable at best.

If you're concerned with IE only (e.g. for an intranet), then have a
look at the showModalDialog method, which does exactly what you're
looking for.

<URL:http://msdn.microsoft.com/workshop/a.../methods/showm
odaldialog.asp>
Alternate approaches to popups include so-called "in-window" popups,
which are DIV-based and therefore modeless; making them modal might also
be doable, but without an acceptable fallback I'm afraid.

<URL:http://www.litotes.demon.co.uk/js_info/pop_ups.html>

All in all, if you're targeting a web environment with unknown user
agents, I'd strongly encourage you to re-design the part of your
application requiring a popup to avoid the usage of popups; that would
save you further problems in the future.
HTH,
Yep.

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.