求一个弹出页面代码,要求如下:
可以用COOKIES记录,只弹出一次
当当前页面打开10秒以后才弹出页面,而不是马上弹出
弹出页面不能在窗口的最前面(当前页面还是在最前面,弹出页面在下面)

解决方案 »

  1.   

    思路:
    1,先带开页面,同时启动函数,先cookie判断,还没有弹出就要求延时10秒后setTimeout("函数名称",指定时间);弹出
    2,cookie 记录
    3,在弹出打开的页面中设置一个函数使父窗口马上获得焦点,即可转移焦点到原来的窗口去,同时把弹出的也面先放后面这好象是163弹出的大屏广告的做法哦
      

  2.   

    例子如下:test01页面打开10秒后弹出test02页面,2秒后广告页面放到下面,原来的父窗口放上面,时间可根据自己需要修改,两个文件放在同一目录中,cookie 判断自己加吧,那也简单文件一 test01.htm
    ---------------------------------------------------------------------------------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>AD SHOW</title>
    </head>
    <style type="text/css">
    body,td{font-family:verdana; font-weight:bold; font-size:12px;}
    </style>
    <script language="javascript" type="text/javascript">
    function openURL(url)
    {
      window.open(url,'','menubar=0,toolbar=0,directories=0,location=0,status=0,scrollbars=0,top=0,left=0,width=1024,height=768');
    }
    </script>
    <body>
    <p>父页面...</p>
    <br>
    <p>父页面...父页面...父页面...父页面...父页面...父页面...父页面...</p>
    <script language="javascript" type="text/javascript">
    setTimeout("openURL('test02.htm')",1000*10);
    //延时10秒钟后弹出
    </script>
    </body>
    </html>文件二 test02.htm
    ---------------------------------------------------------------------------------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>AD  页面</title>
    </head>
    <style type="text/css">
    body,td{font-family:verdana; font-weight:normal; font-size:12px;}
    </style>
    <body>
    <p>AD  页面</p>
    <p>AD  页面</p>
    <p>AD  页面</p>
    <p>AD  页面</p>
    <p>AD  页面</p>
    <p>AD  页面</p>
    <script language="javascript" type="text/javascript">
    function blu()
    {
    opener.focus();
    }
    setTimeout("blu()",1000*2);
    //延时2秒后转移焦点到父窗口,根据你需要设定时间
    </script>
    </body>
    </html>