The default skin for these three nodes is three colors, and each node can be skinned independently and unaffected. Once the skin of a node has been replaced, the skin of the list page and content page under this node will also be replaced with it. This skin-changing approach is as follows:
Analysis of source code can find a few points
1, first to load four files at the top of the page:
The focus here is to give the CSS file ID, as well as the default skin path, the principle is to change the folder path to read different CSS and pictures to achieve the effect of skin change.
Here is the structure code to toggle the button area of the skin
3, and finally insert the following code in the page:
The code is as follows |
Copy Code |
<script language= "javascript" type= "Text/javascript" >
(function (e,d,c) {var b=["#css_zwp"];var a=function (g) {var f= $ (b[0]). attr ("href"). Split ("/") [$ (b[0]). attr ("href"). Split ("/"). Length-2];$.each (B,function (h) {if ($ (b[h)). Size ()!=0) {$ (b[h]). attr ("href", $ (b[h)). attr ("href"). Replace (F,g.find ("a"). attr ("rel"))}};if ($.cookie (d) ==null) { $ (E). each (function (f) {var g=$ (b[0]). attr ("/"). Split ("/") [$ (b[0])-attr ("href"). Split ("/"). Length-2];if ($ (This ). Find ("a"). attr ("rel") ==g) {$ (a). Parent (). Children (). Removeclass (c)-eq (f). AddClass (c)})}else{a ($ (e). EQ ($. Cookie (d)); $ (e). Removeclass (c). EQ ($.cookie (d)). AddClass (c)}$ (e). Click (Function (g) {A ($ (this)), Var h=$ (this). Parent (). Children (); var f=$.inarray (this,h); $.cookie (D,f,{path: "/", Expires:new date (new Date ()) GetTime )}); H.removeclass (c). EQ (f). AddClass (c); G.stoppropagation ()}) (". Theme Li", "theme2", "cur");
(function (e,d,c) {var b=["#css_zw"];var a=function (g) {var f=$ (b[0]). attr ("href"). Split ("/") [$ (b[0]). attr ("href"). Split ("/"). Length-2];$.each (B,function (h) {if ($ (b[h)). Size ()!=0) {$ (b[h]). attr ("href", $ (b[h)). attr ("href"). Replace (F,g.find ("a"). attr ("rel"))};if ($.cookie (d) ==null) {$ (E). each (function (f) {var g=$ (b[0)). attr ("href"). Split ("/") [$ (b[0]). attr ("href"). Split ("/"). Length-2];if ($ (this). Find ("a"). attr ("rel") ==g) {$ (this). Parent (). Children (). Removeclass (c). EQ (f). AddClass (c)})}else{a ($ (e). EQ ($.cookie (d))), $ (e). Removeclass (c). EQ ($.cookie (d) ). AddClass (c)}$ (e). Click (Function (g) {A ($ (this)), Var h=$ (this). Parent (). Children (); var f=$.inarray (THIS,H); $. Cookie (D,f,{path: "/", Expires:new date (new Date (). GetTime () 24*3600*100)}), H.removeclass (c). EQ (f). AddClass (c); G.stoppropagation ()})} (". Theme Li", "theme2", "cur");
|
Notice here that the ID corresponds to the ID that loads the CSS.
In each page plus the above three points can be achieved linkage skin, and finally how to achieve the node before each other affect the skin, only to change the 3rd at the end (". Theme Li", "theme2", "cur") in the middle of theme2 this parameter.