500分求一个特效代码,打开新浪首页之后,顶端会弹出一个大约占1/2屏幕大小的广告,然后过几秒钟广告就逐渐隐藏了这个该怎么做

解决方案 »

  1.   

    window.open("a.htm")a.htm
    =========
    setTimeout(window.close(),3000)
      

  2.   

    window.open("a.htm") a.htm 
    ========= 
    setTimeout(window.close(),3000)
     这个ok?
      

  3.   

    onload时加载广告.调用计时器一段时间后渐隐广告所在html元素
      

  4.   

    <center>
    <div id=fullscreenad style="display:none">&nbsp;</div>
    </center>
    <Script language="Javascript" src="adm.js"></Script>
    <script language="javascript" for="ADAREAlmt" event="fscommand(command,args)">
    if(document.all) this.style.display="none";
    </script>
    <Script language="Javascript">
    AD = new ADM("FULL",1);
    AD.StartTime    = new Array("2008/9/13 00:00");
    AD.EndTime      = new Array("2008/10/20 00:00");
    AD.src          = new Array("ad.gif");
    AD.href         = new Array("http://www.xxx.com/adhref.htm");
    AddSchedule(AD);
    </script>
    -------------------------
    那个adm.js太长了,要的话mail吧:[[email protected]][/email]
      

  5.   

    其实很简单的吧,就是用setTimeout控制div层的style
      

  6.   


    setTimeout(window.close(),3000)
      

  7.   

    window.open()这个是弹窗,很有可能会被屏蔽的;
    以下提供下思路:
    用div来作容器,将广告放入div,在开始的时候,div的display:none;height:1px;即隐藏.
    在page onload时间里面,将div的height高度用一定步长增加(setInterval()来做这件事).
    当达到一定高度之后,停止.之后,等待关闭(不关闭也可以)。
      

  8.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>像163网站顶部展出的大幅广告</title>
       <script type="text/javascript" language="javascript">
        var time = 500;
        var h = 0;
        function addCount()
        {
            if(time>0)
            {
                time--;
                h = h+5;
            }
            else
            {
                return;
            }
            if(h>260)  //高度
            {
                return;
            }
            document.getElementById("ads").style.display = "";
            document.getElementById("ads").style.height = h+"px";
            setTimeout("addCount()",30); 
        }
        
        window.onload = function showAds()
        {
            addCount();
            setTimeout("noneAds()",4000); //停留时间自己适当调整
        }
        </script>
        
        <script type="text/javascript" language="javascript">
        var T = 260;
        var N = 260; //高度
        function noneAds()
        {
            if(T>0)
            {
                T--;
                N = N-5;
            }
            else
            {
                return;
            }
            if(N<0)
            {
                document.getElementById("ads").style.display = "none";
                return;
            }
            
            document.getElementById("ads").style.height = N+"px";
            setTimeout("noneAds()",30); 
        }
        </script>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">
    <!--
    body,td,th {
        font-size: 12px;
        color: #999999;
    line-height:20px}
    .STYLE1 {
        font-size: 24px;
        font-weight: bold;
        color: #FF0000;
    }
    .STYLE2 {
        font-size: 16px;
        font-weight: bold;
        color: #3333CC;
    }
    -->
    </style></head>
    <body>
        <div id="ads" style="margin:auto; display:none; width:900px; top:0px; height:0px; border:solid 1px #000; background-color:#fafafa; overflow:hidden; text-align:center;">
    <td width="900" height="280"><a href="http://www.chinaz.com"><img src="http://220.189.240.168:8090/images/site.jpg" border="0" alt="中国站长站"></a></td>
        </div>
        <div style="margin:auto; width:900px; height:200px; border:solid 1px #000; background-color:#fafafa; text-align:center;">
            <div align="left"><br>
              <span class="STYLE1"></span><br>
              <span class="STYLE2"> </span><br>
                   </div>
        </div>
    </body>
    </html>
    我在你另外一篇帖子上也发了
      

  9.   

    jquery版,自己做着玩的。
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>jquery 插件 plugin 消息插件--亮亮的博客</title>
    <script type="text/javascript" src="jquery-1.2.6.pack.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    $(document.body).prepend('<div id="ad" style=" width:1024px; height:768px; display:none;"><img src="1.jpg" width="1024" height="768" /></div>');
    if(!$('#ad').is('div')){ return; }
    $('#ad').slideDown(1000);
    setTimeout("closeAd()",4000); 
    });
    function closeAd()
    {
    if(!$('#ad').is('div')){ return; }
    $('#ad').slideUp(1000);
    setTimeout("$('#ad').remove();",1000); 

    }
    </script>
    <style type="text/css">
    <!--
    *{ margin:0; border:0; padding:0;}
    -->
    </style>
    </head><body>

    </body>
    </html>