Go Premium for a chance to win a PS4. Enter to Win

x
?
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,012 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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…
Suggested Courses

972 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