?
Solved

How to make a pop-up window stay in the foreground while working on another page.

Posted on 2007-11-17
7
Medium Priority
?
1,010 Views
Last Modified: 2008-02-01
Hello.  I have a small script for a Javascript pop-up window.  (Attached)

I would like to know if it's possible to have that window maintain the foreground presence when working on other pages, rather than having it lost in the background after clicking on another window.  (I am wanting to place a legend on the pop-up window while a user is completing a form so they can easily reference the meanings.)

How would this be possible?

Thanks so much,
Shane
<a href= "#" onclick="window.open('watchlist_email.asp?classID=<%=(rsWatchlist.Fields.Item("classID").Value)%>','window1','height=300,width=500,top=200,left=400,resizable=0'); return false;">E-mail</a>

Open in new window

0
Comment
Question by:lshane
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 28

Expert Comment

by:gamebits
ID: 20305890
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20305936
<body onBlur="self.focus()">

put this in your <body> tag of your popup.

Alternatively,
<script language="javascript" type="text/javascript">
<!--
window.onblur = function() {
      self.focus();
}
//-->
</script>

Bearing in mind the 2 pointers below:
1. Does not work on all browsers, so test and see which browsers it works on.
2. This is extremely annoying sometimes, and may confuse/annoy the user, so best to make minimal use of this.
0
 

Author Comment

by:lshane
ID: 20305996
Hi, nizsmo.  Thank you.  OK - so going with your solution:

What I'm wanting is the user to go to a page where they have to complete a form.
One of the items on the form requires additional definitions - a color legend, for example.
I'm just wanting a "Question Mark" image there for the user to click.

When they click it - that's when I want the pop-up to window to appear, as it will have the definitions for the field item the user is completing. They will need to look back and forth from the form to the pop-up window to complete the form, as there are multiple entries.

When they are finished - they can click on a link from the pop-up window to close it.

From what I can tell from your solution, it seems as though I can still use my current pop-up script.
I just need to add the <onBlur="self.focus()"> to the <BODY> tag of my pop-up window page.

Is that right?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:lshane
ID: 20306006
Also I'm using IE6 - so will the majority of the users.

I tried adding onBlur="self.focus()" to my <BODY> tag, but the window still does not stay in the forefront when I click off of it.

Maybe you could help me with placement of the code, etc.
0
 
LVL 21

Accepted Solution

by:
nizsmo earned 2000 total points
ID: 20306082
sorry Ishane, try:

<body onBlur="window.focus()">

self doesn't seem to work, so change it to window should work!
0
 

Author Comment

by:lshane
ID: 20324825
Thanks so much!
0
 
LVL 21

Expert Comment

by:nizsmo
ID: 20324934
glad to help :)
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

719 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