网页顶部大幅自动伸缩广告代码

作者:我就是个世界 发表于:2008-10-28
[html]
  
  
    

    [/html]

[color=#FF0000]代码如下:[/color][separator]

[code]<head>
   <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>360)  //高度
        {
            return;
        }
        document.getElementById("ads").style.display = "";
        document.getElementById("ads").style.height = h+"px";
        setTimeout("addCount()",30);
    }
  
    window.onload = function showAds()
    {
        addCount();
        setTimeout("noneAds()",10000); //停留时间自己适当调整
    }
    </script>
  
    <script type="text/javascript" language="javascript">
    var T = 360;
    var N = 360; //高度
    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>
</style></head>
    <div id="ads" style="margin:auto; display:none; width:1000px; top:0px; height:0px; border:solid 1px #000; background-color:#fafafa; overflow:hidden; text-align:center;">
<td width="992" height="360"><a href="http://www.husw.net"><img src="fenglu.gif" border="0" alt="冯潞博客"><BR><img src="banzhu2.gif" border="0" alt="招聘版主"><BR><img src="lujun.gif" border="0" alt="潞君视角"></a></td>
    </div>[/code]

分享:

扫一扫在手机阅读、分享本文

请发表您的评论