打开网页后定时显示大图片广告然后自动关闭

上一篇 / 下一篇  2007-08-31 17:32:08 / 个人分类:网站制作

 <!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>顶部展出的大幅广告</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>500)  //高度
        {
            return;
        }
        document.getElementById("ads").style.display = "";
        document.getElementById("ads").style.height = h+"px";
        setTimeout("addCount()",30);
    }
   
    window.onload = function showAds()
    {
        addCount();
        setTimeout("noneAds()",7000); //停留时间自己适当调整
    }
    </script>
   
    <script. type="text/javascript" language="javascript">
    var T = 500;
    var N = 500; //高度
    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>
</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;">
        <a target="_blank" href="#">loveleaf88---广告内容哦。</a>
    </div>
    <div style="margin:auto; width:900px; height:200px; border:solid 1px #000; background-color:#fafafa; text-align:center;">
        网站主体内容
    </div>
</body>
</html>


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-07-03  
  12345
6789101112
13141516171819
20212223242526
2728293031  

我的存档

数据统计

  • 访问量: 208
  • 日志数: 8
  • 建立时间: 2007-08-31
  • 更新时间: 2007-08-31

RSS订阅

Open Toolbar