Click to See Complete Forum and Search --> : How can I get a popup window in the back


morgan
12-15-2002, 06:32 AM
Hello,
I'm new here and will come back frequently to try to learn a few things here and there.
I picked up a JavaScript and have been using it a while.
It's a popup window and my question is:
How can I re write it so the popup window don't show in front but
open in the back or behing the page currently open?

I would be very grateful to you if you could help me.
the script is below,
Thanks
Morgan in Sweden

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
closetime = 0; // Close window after __ number of seconds?
// 0 = do not close, anything else = number of seconds

function Start(URL, WIDTH, HEIGHT) {
windowprops = "left=259,top=278,width=" + WIDTH + ",height=" + HEIGHT;
preview = window.open(URL, "preview", windowprops);
if (closetime) setTimeout("preview.close();", closetime*1000);
}

function doPopup() {
url = "http://www.britbike.com/regalia/ads/ads_popup.html";
width = 267; // width of window in pixels
height =156; // height of window in pixels
delay = 0; // time in seconds before popup opens
timer = setTimeout("Start(url, width, height)", delay*1000);
}
// End -->
</script>

The body tag is:
<body OnLoad="doPopup();" bgcolor="#FFFFFF" topmargin="0">

vickers_bits
12-15-2002, 07:09 AM
use window.focus();
after preview = window.open()
you can still see it for a fraction of a second though

also you're using setTimeout with a delay of 0. you should get rid of that unless you intend to use it.

morgan
12-15-2002, 07:15 AM
Thansk for the reply, i'm a novice here so I need to know between which lines should I paste in

use window.focus();
after preview = window.open()