Solved

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

Posted on 2007-11-17
7
995 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 500 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now