zoukankan      html  css  js  c++  java
  • 漂浮广告(从上往下飘最后消失)

    代码
       <script type="text/javascript"> 
            
                
    var adtime = 100;   //时间
                var adheight =0;    //高度
                
                $(document).ready(
    function(){
                    addCount(); 
                    adtime
    =300;
                    setTimeout(
    "noneAds()",7000); //停留时间
                })
     
                
    function addCount() 
                { 
                    
    if(adtime>0) { 
                        adtime
    --
                        adheight 
    = adheight+5
                    }
    else { 
                        
    return
                    } 
                    
    if(adheight>415)  //高度 
                    { 
                        
    return
                    } 
                    document.getElementById(
    "ad01").style.display = ""
                    document.getElementById(
    "ad01").style.height = adheight+"px"
                    setTimeout(
    "addCount()",30); 
                } 
                
    var N = 415//高度 
                function noneAds() { 
                    
    if(adtime>0){ 
                        adtime
    --
                        N 
    = N-5
                    }
    else { 
                        
    return
                    } 
                    
    if(N<0){ 
                        document.getElementById(
    "ad01").style.display = "none"
                        
    return
                    } 
                    document.getElementById(
    "ad01").style.height = N+"px"
                    setTimeout(
    "noneAds()",30); 
                } 
            
    </script> 
  • 相关阅读:
    rsync命令使用方法
    Mysql(MyISAM和InnoDB)及Btree和索引优化
    初级java程序员-各公司技能要求
    Redis学习笔记二 (BitMap算法分析与BitCount语法)
    HTTP、TCP、IP协议常见面试题
    Redis学习笔记一(Redis的详细安装及Linux环境变量配置和启动)
    java-部分精选面试题
    Python基础-TypeError:takes 2 positional arguments but 3 were given
    Python3.7中urllib.urlopen 报错问题
    几道关于springboot、springCloud的面试题。
  • 原文地址:https://www.cnblogs.com/fanxianhua/p/1650665.html
Copyright © 2011-2022 走看看