zoukankan      html  css  js  c++  java
  • 换皮肤功能link

    换肤功能
    创建Css类,主要是对link元素操作
    <link rel="stylesheet" type="text/css" media="all" href="styles/red.css"  />
    元素标签-link  属性标签-rel、type、media、href


    var head = document.getElementsByTagName("head")[0];
    this.Append = function(url){
        var link = document.createElement("link");
        link.rel = "stylesheet";
        link.type = "text/css";
        link.media = "all";
        link.href = url;
        if (head) {
           head.appendChild(link);
        }
        else {
            document.documentElement.appendChild(link);
        }
        return link;
    }

    this.Remove = function (obj) {
       if (typeof (obj) == "object" && obj.rel == "stylesheet") {
           obj.rel = "NoCss";
       if (head) head.removeChild(obj);
       else document.documentElement.removeChild(obj);
            return true;
       }
       else {
            return false;
        }
    }

  • 相关阅读:
    vim 显示行号 临时&永久
    ubuntu redis config IP password
    Vulnerability Scanning Tools
    Tomcat清理无用应用防止漏洞
    XSS平台-学习
    Amazon aws s3 加速
    XSS的DOS攻击之 server limit dos
    Linux Nginx naxsi
    Acunetix Web Vulnerability Scanner abbr. AWVS
    nginx: [emerg] open() "/var/run/nginx.pid" failed (13: Permission denied)
  • 原文地址:https://www.cnblogs.com/kuikui/p/2336090.html
Copyright © 2011-2022 走看看