Call pop up window always on top

Not real big with JS but am going through a bunch of books and tuts ect.

For the moment I would like to know if there is a way to call up a pop up window from a button (have that done already) but have it stay on top of the main browser when you click back on the main browser. I’m using … to call the pop up window but have not found how to get the new window to stay on top when working back in original browser window that the pop-up was called from. Was able to set height, width, etc of the pop-up but not able to get it to stay on top. The one reference I saw was in an older book that stated it was only available in IE.

Could someone help me out here?

Would also like to know how to position the pop-up window when it is called.

Did not see a way to do this but maybe just didn’t know what I was looking at or put the pieces together.


Am I the only one who thinks the Rangers major league choked last night? Can’t get one more strike, or just hold the opposition to only one run in an bat, twice each, to be world champs??? Are you kidding? I don’t even care and I can’t believe it. Move over Cubs.

I’m not sure about getting the pop-up to stay on top, but I’d be surprised if you could get it to work in anything other than IE. (That’s not to say it’s not worth still looking; that’s a big portion of the market. And it would be just like IE to make some proprietary way to do that.)

Positioning the pop-up is much easier:'url.html', 'whatever', 'top=100,left=100');

I don’t actually watch baseball :confused:

Since you have almost zero chance of it actually popping up in the first place (more likely it would open in a new tab if it opens at all) the fact that there is no way to keep it on top is not really going to affect things much.

Perhaps you should look for a lightbox script instead as that allows you to do an in page popup that is always on top of the rest of the page.

Hi felgall,

Now you have me worried as it seems to work fine. Click, and it opens every time. What is it, like rookies luck? and now I have to worry that it is going to fail at some point? From what I’m seeing, supposedly the second attribute in a is the target. On the other hand, as a rookie and looking at the number of posts you have… and consider that proper testing has not been done in some of the more off beat browsers, say IE6, 7, 8 or 9 and now I’m not so sure. lol

Lightbox you say? will check into it.

Is there any way to specify a location on a new window call?


Only in browsers that are configured to allow it. Many of your visitors will have their browser configured differently to yours.

I have my browser set so that requests to open a new window either open in a new tab or simply replace the current page depending on how the call is being made.