Solved

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

Posted on 2007-11-17
7
1,005 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP sending two datas 2 23
How to check or uncheck a checkbox using the id of the checkbox 2 23
Html using "Or" in condition 3 29
JS to redirect to prev page 8 25
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…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…

697 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