zoukankan      html  css  js  c++  java
  • 网页顶部或者底部广告代码 可定时关闭 可用于网站通知等

    网页顶部或者底部广告代码 可定时关闭 可用于网站通知等

    <div id="ads" style="900px;height:40px;background:green;margin:0 auto; color:#fff;float:inline"><span style="color:#FF0033";float:left">Warm Tips</span>:Due to Chinese New Year holidays,We will on holiday from Jan.20 to Jan.27,so during this time we can not ship goods during this time.Feel free to contact live-chat for questions about items availability. We apologize for inconvenience and rely on your understanding.</div> 
    <script type="text/javascript">
    var time = 300;
    var h = 0;
    function addCount()
    {
    if(time>0)
    {
    time
    --;
    h
    = h+5;
    }
    else
    {
    return;
    }
    if(h>50) //高度
    {
    return;
    }
    document.getElementById(
    "ads").style.display = "";
    document.getElementById(
    "ads").style.height = h+"px";
    setTimeout(
    "addCount()",30);
    }
    window.onload
    = function showAds()
    {
    addCount();
    setTimeout(
    "noneAds()",9800); //停留时间自己调了
    }
    var T = 100;
    var N = 100; //高度
    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>



    网页顶部或者底部广告代码 可定时关闭 可用于网站通知等

  • 相关阅读:
    学习WindowsPhone 2013/12/22
    spring-aop学习
    easymock+junit+spring学习·
    javaWeb实现文件上传与下载 (转)
    Java实现视频网站的视频上传、视频转码、视频关键帧抽图, 及视频播放功能
    jsp自定义标签
    listener监听器
    移植一个项目到本地的问题
    struts1拦截器
    eclipse开发 javafx(转)
  • 原文地址:https://www.cnblogs.com/waimaole/p/2329249.html
Copyright © 2011-2022 走看看