Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-18-2004, 08:11 PM   PM User | #1
ggallen
Regular Coder

 
Join Date: Jul 2003
Location: NJ - #29 if you must know
Posts: 117
Thanks: 0
Thanked 0 Times in 0 Posts
ggallen is an unknown quantity at this point
making a popup "always" on top

What parameter would I pass (for IE) to keep a pop-up
always on top?
ggallen is offline   Reply With Quote
Old 03-18-2004, 08:15 PM   PM User | #2
FastCougar
Regular Coder

 
Join Date: Jan 2004
Posts: 117
Thanks: 0
Thanked 0 Times in 0 Posts
FastCougar is an unknown quantity at this point
In the body line of the popup window add:
Code:
onBlur="self.focus();"
FastCougar is offline   Reply With Quote
Old 03-18-2004, 08:24 PM   PM User | #3
ggallen
Regular Coder

 
Join Date: Jul 2003
Location: NJ - #29 if you must know
Posts: 117
Thanks: 0
Thanked 0 Times in 0 Posts
ggallen is an unknown quantity at this point
Hmm. Didn't give an error, but didn't keep it on top either.

<HEAD>
<TITLE>Check Full Name</TITLE>
</HEAD>
<BODY onBlur='self.focus();'>

is how the pop-up starts....
ggallen is offline   Reply With Quote
Old 03-18-2004, 08:30 PM   PM User | #4
FastCougar
Regular Coder

 
Join Date: Jan 2004
Posts: 117
Thanks: 0
Thanked 0 Times in 0 Posts
FastCougar is an unknown quantity at this point
try window.focus(); instead
FastCougar is offline   Reply With Quote
Old 03-18-2004, 08:37 PM   PM User | #5
ggallen
Regular Coder

 
Join Date: Jul 2003
Location: NJ - #29 if you must know
Posts: 117
Thanks: 0
Thanked 0 Times in 0 Posts
ggallen is an unknown quantity at this point
no. still won't stay on top.

Here's the problem

The parent page spawns off a small pop-up,
if someone accidentally clicks anywhere outside the popup
window, the parent window becomes focused.

and you have to click on the toolbar at the bottom to
refocus the pop-up window.

I thought there was a parameter you could pass when you
open the window that would keep it on top...

George
ggallen is offline   Reply With Quote
Old 03-19-2004, 04:41 AM   PM User | #6
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
If your target browser is IE only, you can use Modal or Modeless dialog boxes.
Mozilla also has modal window. - http://www.codingforums.com/showthre...threadid=30267
In that link, there's a post that linked to a simulated modal windows that work cross-browser.
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app

Last edited by glenngv; 03-19-2004 at 04:47 AM..
glenngv is offline   Reply With Quote
Old 03-19-2004, 04:45 AM   PM User | #7
JohnKrutsch
Regular Coder

 
Join Date: Jun 2002
Location: The Planet Earth Code Poet: True
Posts: 282
Thanks: 0
Thanked 1 Time in 1 Post
JohnKrutsch is an unknown quantity at this point
You could try continually setting focus:

<body onload="setInterval(window.focus()',200)">
JohnKrutsch is offline   Reply With Quote
Old 03-19-2004, 04:49 AM   PM User | #8
fredmv
Regular Coder

 
Join Date: Jul 2003
Location: Massachusetts
Posts: 472
Thanks: 0
Thanked 0 Times in 0 Posts
fredmv is an unknown quantity at this point
John's solution should work fine (assuming you correct the slight syntax error) though there isn't really a need to continually request focus. Listening for an onblur event and then waiting a small amount of time before requesting focus should do the job. See: http://www.webdevfaqs.com/javascript.php#altpopupfocus.
fredmv is offline   Reply With Quote
Old 03-19-2004, 04:55 AM   PM User | #9
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
That would be annoying because you can't focus to other opened applications. You only bring the focus back to the popup if the focus is currently in the parent window not in other applications. I think that's what the author did in the link that I mentioned in my previous post.
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 03-19-2004, 04:59 AM   PM User | #10
fredmv
Regular Coder

 
Join Date: Jul 2003
Location: Massachusetts
Posts: 472
Thanks: 0
Thanked 0 Times in 0 Posts
fredmv is an unknown quantity at this point
Good point Glenn. The most practical solution would likely be to check if it's IE, if so, use showModalDialog; if Mozilla, use openDialog. Though, it would be nice if there was some kind of universal method or parameter that could be used&hellip;
fredmv is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:22 AM.


Advertisement
Log in to turn off these ads.