Solved

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

Posted on 2007-11-17
7
1,007 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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

630 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