Click to See Complete Forum and Search --> : popup after 5 sec


Alicia
01-01-2004, 06:48 PM
Hi guys,

now i got this popup window script and i wish to make the window pop up after 5 seconds the visitor view my site instead of onload... what i have to do to make this work ??

my code:
window.open('popup.htm','','menubar=no,resizable=yes,width=430,height=580');


please advise.

fredmv
01-01-2004, 06:50 PM
<script type="text/javascript">
//<![CDATA[
onload = function()
{
setTimeout
(
function()
{
window.open('popup.htm', '', 'width=430,height=580,resizable=yes');
},
5000
);
}
//]]>
</script>

Alicia
01-01-2004, 08:07 PM
thanks for ur help..

another question is,,

5000 = 5 seconds
then how about 15 sec ??

do u guys mind to let me know how to adjust the time ??


15 sec is it = 15000 ??

fredmv
01-01-2004, 08:12 PM
You're welcome. Yes; it would be 15000 since the delay is represented in milliseconds.

Alicia
01-01-2004, 08:22 PM
why it is not working.. do u guys mind to check my code for a while ,, thanks..

my code:
if (readCookie("visited")) {
// user has been here before
}
else
{
setTimeout
(
function()
{
window.open('popup.htm', '', 'width=430,height=580,resizable=yes');
},
15000
);

}

fredmv
01-01-2004, 08:25 PM
Works fine for me. Maybe the function that checks to see if the cookie is set is faulty?

Alicia
01-01-2004, 08:32 PM
it is working now.. thanks

fredmv
01-01-2004, 08:39 PM
Maybe you were looking at the cached version of the page? Who knows. Anyway, you're welcome. ;)