http://community.csdn.net/Expert/topic/3749/3749114.xml?temp=.7634088

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>无标题文档</title>
    </head><body>
    <div id="g_xx" style="position:absolute; width:1024px; height:500px; z-index:1; left: 0px; top: 0px; border: 1px none #000000;" align=center>
      <div align="center"><font style='font-size:200px;' color=#ff0000>广告位</font></div>
    </div>
    <script>
    top_t = -500; //当前广告条距离顶部的最小位置
    top_d = 0; //当前广告条距离顶部的最大位置
    start_d();
    function start_d() //广告下滚控制函数
    {
    top_t += 20;
    document.all.g_xx.style.top = top_t;
    if (top_t < top_d){
    window.setTimeout("start_d()", 50);
    } else {
    window.setTimeout("start_u()", 3000);
    }
    }
    function start_u() //广告上滚控制函数
    {
    top_t -= 20;
    document.all.g_xx.style.top = top_t;
    if (top_t > -500){
    window.setTimeout("start_u()", 50);
    }
    }
    </script>
    </body>
    </html>
      

  2.   

    也就是这个的效果:
    http://blog.csdn.net/manyou