Click to See Complete Forum and Search --> : "Pop-Under" windows


randyb
02-12-2003, 05:32 PM
how would i write the code to keep a pop-up window underneath a parent window?

Sergey Smirnov
02-12-2003, 06:23 PM
Code for parent window:

<script language="javascript">
var sdown = window.open("pop_down_url_here","name_here","params_here");
sdown.blur();
window.onblur = function() {
if (sdown.focus)
window.focus();
}
</script>

or/and

code for pop-down window:

<script language="javascript">
window.onfocus= function() {
if (window.opener)
window.opener.focus();
}
</script>

Might do not work in some builds of Netscape 6.*, because of bug with blur(), focus() functions.

randyb
02-12-2003, 06:36 PM
i got it to work.