• cookie


    <!DOCTYPE html>
    
    <html lang="en">
    
    <head>
    
    <meta charset="UTF-8">
    
    <title>Document</title>
    
    <style type="text/css">
    
    .float_mask{position: fixed;z-index: 19999;display:none; 100%;right: 0; bottom: 0;height: 105px;_bottom: auto;_ 100%;_position: absolute; 
    
    _top: expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));} 
    
    .float_layer{position: absolute;left: 0;top: 0;z-index: 1; 100%;height: 100%;background: #071828;filter: alpha(opacity=80);opacity: 0.80;} 
    
    .float_content{ position: relative;z-index: 2; 1005px;height: 100%;margin: 0 auto;padding-left: 70px;} 
    
    .float_bg, .float_close{ float: left;} 
    
    .float_bg{position: relative; 820px;height: 135px;margin-top: -27px;} 
    
    .float_slogan {position: absolute; background:#000;} 
    
    .float_slogan{left: 0;bottom: 0; 800px;height: 135px;cursor: pointer;} 
    
    .float_close{ 60px;margin-top: 30px;} 
    
    .float_close a {display: block; 53px; height: 52px; margin-left: 7px; background:#e00;-webkit-transition: all 400ms;} 
    
    </style>
    
    </head>
    
    <body>
    
    <div class="float_mask" id="float_mask"> 
    
        <div class="float_layer"> 
    
        </div> 
    
        <div class="float_content clearfix"> 
    
            <div class="float_bg"> 
    
                <a target="_blank" href="http://www.helloweba.com/" title='广告部分'> 
    
                    <div class="float_slogan"><!--广告内容--></div> 
    
                </a> 
    
            </div> 
    
            <div class="float_close"> 
    
                <a onclick="closeFootAd()" href="#" title="我知道了"></a> 
    
            </div> 
    
        </div> 
    
    </div> 
    
    <script type="text/javascript">
    
    window.onload = function(){ 
    
        if(getCookie("footad")==0){ 
    
            document.getElementById("float_mask").style.display="none"; 
    
        }else{ 
    
            document.getElementById("float_mask").style.display="block"; 
    
        } 
    
    } 
    
    //关闭底部广告 
    
    function closeFootAd() { 
    
        document.getElementById("float_mask").style.display="none"; 
    
        setCookie("footad","0");  
    
    } 
    
        
    
    //设置cookie  
    
    function setCookie(name,value){  
    
        var exp = new Date();   
    
        exp.setTime(exp.getTime() + 1*60*60*1000);//有效期1小时  
    
        document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();  
    
    }  
    
    //取cookies函数  
    
    function getCookie(name){  
    
        var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));  
    
        if(arr != null) return unescape(arr[2]); return null;  
    
    }  
    
    </script>
    
    </body>
    
    </html>
    
  • 相关阅读:
    第一章--购物车作业
    第一章--三级菜单作业
    第3章 文件操作-函数练习题
    面试题2.20
    Python 技巧(三)—— list 删除一个元素的三种做法
    Python 字符串操作方法大全
    员工信息增删改查程序
    Python之print函数详解
    判断登陆用户名和密码是否正确-记事本存用户名密码
    软件开发目录规范
  • 原文地址:https://www.cnblogs.com/honeyHHX/p/4687318.html
Copyright © 2020-2023  润新知