


Web css implements mutual switching of styles across the entire site_javascript skills
Post the code directly
//取元素 用两个$是为了不与jquery冲突
function $$(s) {
return document.getElementById(s);
}
function setblue() {
//先写cookie
//writeCookie("ISCSSSTYLE", "css/CRM_blue.css", 365, true);
//设置新的css文件
$$("maincss").href = "css/CRM_blue.css";
//取主框架页,并重新设置css文件
//var childobj = window.parent.document.getElementById("ManagerMain").contentWindow;
//childobj.document.getElementById("maincss").href = "css/CRM_blue.css";
}
function setgreen() {
//先写cookie
//writeCookie("ISCSSSTYLE", "css/CRM.css", 365, true);
//设置新的css文件
$$('maincss').href = "css/CRM.css";
//取主框架页,并重新设置css文件
//var childobj = window.parent.document.getElementById("ManagerMain").contentWindow;
//childobj.document.getElementById("maincss").href = "css/CRM.css";
}
function setgray() {
//先写cookie
//writeCookie("ISCSSSTYLE", "css/CRM_gray.css", 365, true);
//设置新的css文件
$$('maincss').href = "css/CRM_gray.css";
//取主框架页,并重新设置css文件
//var childobj = window.parent.document.getElementById("ManagerMain").contentWindow;
//childobj.document.getElementById("maincss").href = "css/CRM_gray.css";
}
function setActiveStyleSheet(title) {
// var i, a, main;
// for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
// {
// if(a.getAttribute("rel").indexOf("style")!= -1 && a.getAttribute("title"))
// {
// a.disabled = true;
// if(a.getAttribute("title") == title)
// a.disabled = false;
// }
// }
//$$("maincss").attr("href", "css/CRM_blue.css");
//$$('maincss').href = "css/CRM_blue.css";
//设置css的文件
$$('maincss').href = title;
}
function getActiveStyleSheet() {
// var i, a;
// for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
// {
// if(a.getAttribute("rel").indexOf("style")!= -1 &&
// a.getAttribute("title") && !a.disabled)
// return a.getAttribute("title");
// }
// return null;
var cssfile = $$('maincss').href;
//alert(cssfile);
return cssfile;
}
function getPreferredStyleSheet() {
// var i, a;
// for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
// {
// if(a.getAttribute("rel").indexOf("style") != -1
// && a.getAttribute("rel").indexOf("alt") == -1
// && a.getAttribute("title"))
// return a.getAttribute("title");
// }
// return null;
var cssfile = $$('maincss').href;
//alert(cssfile);
return cssfile;
}
function createCookie(name, value, days) {
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
}
else
expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
}
function writeCookie(name, value, hours, escp) {
var expire = "";
if (hours != null) {
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires=" + expire.toGMTString();
}
if (escp == "True") {
document.cookie = name + "=" + value + expire;
} else {
document.cookie = name + "=" + escape(value) + expire;
}
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ')
c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0)
return c.substring(nameEQ.length, c.length);
}
return null;
}
$(document).ready(function() {
//var title = readCookie("ISCSSSTYLE");
//var title = "css/CRM_blue.css";
//if (title != null && title != "undefined") {
// setActiveStyleSheet(title);
//}
});

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Using Bootstrap in Vue.js is divided into five steps: Install Bootstrap. Import Bootstrap in main.js. Use the Bootstrap component directly in the template. Optional: Custom style. Optional: Use plug-ins.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

There are two ways to create a Bootstrap split line: using the tag, which creates a horizontal split line. Use the CSS border property to create custom style split lines.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

There are several ways to insert images in Bootstrap: insert images directly, using the HTML img tag. With the Bootstrap image component, you can provide responsive images and more styles. Set the image size, use the img-fluid class to make the image adaptable. Set the border, using the img-bordered class. Set the rounded corners and use the img-rounded class. Set the shadow, use the shadow class. Resize and position the image, using CSS style. Using the background image, use the background-image CSS property.

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.

To adjust the size of elements in Bootstrap, you can use the dimension class, which includes: adjusting width: .col-, .w-, .mw-adjust height: .h-, .min-h-, .max-h-

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text
