zoukankan      html  css  js  c++  java
  • 网页顶端显示消息

    var cookiename=getCookie("screentopdiv");
    if (cookiename == "0") {
    document.write('<div id="screentopdiv" style=" text-align: center; font-size: 14px; padding: 5px 0; background-color: rgb(232, 72, 72); color: white;">Dear Customers, your order may will be delayed 1-3 days due to the strict inspections by customs in HK. <span style="float:right;margin-right: 5px;">&nbsp;</span> <span onclick="closetopdiv()" style="float:right;cursor: pointer;-webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);">+</span></div>');
    }
    else {
    if(document.getElementById("screentopdiv"))
    document.getElementById('screentopdiv').style.display = "none";
    }
    function closetopdiv() {
    document.getElementById('screentopdiv').style.display = "none";
    addCookie("screentopdiv", "1", 0);
    }
    function addCookie(objName,objValue,objHours){//添加cookie
    var str = objName + "=" + escape(objValue);
    if(objHours > 0){//为0时不设定过期时间,浏览器关闭时cookie自动消失
    var date = new Date();
    var ms = objHours*3600*1000;
    date.setTime(date.getTime() + ms);
    str += "; expires=" + date.toGMTString();
    }
    document.cookie = str;
    }
    function getCookie(objName){//获取指定名称的cookie的值
    var arrStr = document.cookie.split("; ");
    for(var i = 0;i < arrStr.length;i ++){
    var temp = arrStr[i].split("=");
    if(temp[0] == objName)
    return unescape(temp[1]);
    }
    return "0";
    }
    function delCookie(name){//为了删除指定名称的cookie,可以将其过期时间设定为一个过去的时间
    var date = new Date();
    date.setTime(date.getTime() - 10000);
    document.cookie = name + "=a; expires=" + date.toGMTString();
    }

  • 相关阅读:
    Using System Partitioning
    startup命令
    [转]Oracle 10g/11g 密码策略 用户口令 大小写敏感
    [转]Oracle DB 加强的数据安全管理
    Scheduling Jobs with Oracle Scheduler
    [转]Oracle DB SQL 计划管理
    Performing Time-Based or Change-Based Incomplete Recovery
    闪回数据归档
    Managing Optimizer Statistics
    性能测试--十个命令迅速发现性能问题
  • 原文地址:https://www.cnblogs.com/kingreatwill/p/4028366.html
Copyright © 2011-2022 走看看