Css allows you to easily switch the entire site style. If you need a friend, you can refer to it and hope to help you paste the Code directly.
The Code is as follows:
// Use two $ elements to avoid conflict with jquery.
Function $ (s ){
Return document. getElementById (s );
}
Function setblue (){
// Write cookie first
// WriteCookie ("ISCSSSTYLE", "css/CRM_blue.css? 6.1.3 ", 365, true );
// Set a new css file
$ ("Maincss"). href = "css/CRM_blue.css? 6.1.3 ";
// Retrieve the main frame page and reset the css file
// Var childobj = maid parent.doc ument. getElementById ("ManagerMain"). contentWindow;
// Childobj.doc ument. getElementById ("maincss"). href = "css/CRM_blue.css? 6.1.3 ";
}
Function setgreen (){
// Write cookie first
// WriteCookie ("ISCSSSTYLE", "css/CRM.css? 6.1.3 ", 365, true );
// Set a new css file
$ ('Maincss '). href = "css/CRM.css? 6.1.3 ";
// Retrieve the main frame page and reset the css file
// Var childobj = maid parent.doc ument. getElementById ("ManagerMain"). contentWindow;
// Childobj.doc ument. getElementById ("maincss"). href = "css/CRM.css? 6.1.3 ";
}
Function setgray (){
// Write cookie first
// WriteCookie ("ISCSSSTYLE", "css/CRM_gray.css? 6.1.3 ", 365, true );
// Set a new css file
$ ('Maincss '). href = "css/CRM_gray.css? 6.1.3 ";
// Retrieve the main frame page and reset the css file
// Var childobj = maid parent.doc ument. getElementById ("ManagerMain"). contentWindow;
// Childobj.doc ument. getElementById ("maincss"). href = "css/CRM_gray.css? 6.1.3 ";
}
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? 6.1.3 ");
// $ ('Maincss '). href = "css/CRM_blue.css? 6.1.3 ";
// Set the css file
$ ('Maincss '). href = title;
}
Function getActiveStyleSheet (){
// Var I,;
// 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,;
// 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 * 24x60*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 (). 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? 6.1.3 ";
// If (title! = Null & title! = "Undefined "){
// SetActiveStyleSheet (title );
//}
});