PDA

View Full Version : fixed popup



nuc
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

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


onblur=function(){self.focus();};

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):


onblur=function(){setTimeout('self.focus()',1000);};

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.

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