View Full Version : fixed popup

06-18-2007, 11:19 AM
hi all,

i have a issue with a pop up window. when the index file loads i open a pop up window which is another html file. while clicking on the main window the pop window goes under the main window. how to make the pop window always stay over the main window? can anyone help me in this.

thanks in advance

06-18-2007, 02:18 PM
Well, the pop up is loosing focus. You could, on the page in the pop up:


But, that will override the click actions on the main page. If instead, when you opened the pop up, you assigned it a variable, like (on the main page):

var bob=window.open('pop.htm','','width=300, height=300, top=200, left=200');

You could then construct javascript events on the main page that would execute and then return focus to the pop up:

<span onclick="alert('here');bob.focus();">alert</span>

But, if both pages were opened at once from another page, it gets tricky and I'm not sure that the variable for the pop up can be easily passed to the new main page, unless the opening page remains open. It can in FF, but not in others. Others can use code like so (on the pop up):


but FF cannot. Code branching might be able to decide which method to use. At his point though, if this is the situation, you might consider, instead of opening a pop up, using a DHTML pop up division.

06-21-2007, 04:20 AM
thanks...that helped a lot