< link href = "css/default.css" rel = "stylesheet" type = "text/css" id = "cssfile" / >
< script type = "text/javascript" >
// <! [CDATA[
$(function(){
var $li =$("#skin a");
$li.click(function(){
switchSkin( this.id );
});
var cookie_skin = $.cookie( "MyCssSkin");
if (cookie_skin) {
switchSkin( cookie_skin );
}
});
function switchSkin(skinName){
$("#"+skinName).addClass("selected").siblings().removeClass("selected");
//The current<li>element is selected
//Remove the selection of other peer<li>elements
$("#cssfile").attr("href","css/"+ skinName +".css");
//Set different skins
$.cookie( "MyCssSkin" , skinName , { path: '/', expires: 10 });
}
//]]>
< / script >
< div class = "bt-yf" >< a href = "javascript:void(0);" id = "yifu" class = "bt-btn-yf" title = "Skin changing" > skin peeler < / a >< / div >
.bt-btn-yf { display : block ; width : 38px ; height : 38px ; background : #bababa url ( ../images/yf.png ) no-repeat 50% 50% ; position : fixed ; z-index : nine thousand nine hundred and ninety-nine ; right : 10px ; bottom : 20% ; background-size : 80% 80% ; margin-top : 5px ; }
.show-yf { display : none ; position : fixed ; right : 10px ; top : 50% ; width : 50px ; z-index : nine hundred and ninety-nine ; text-align : center ; }
.show-yf a { display : block ; padding : 10px zero ; height : 60px ; line-height : 40px ; }
.qey { background : #fff ; color : #333 }
.sey { background : #333 ; color : #fff ; }
@media ( max-width : 767px ) {
.show-yf { right : 10px ; top : 40% ; width : 30px ; z-index : nine hundred and ninety-nine ; text-align : center ; }
.show-yf a { display : block ; padding : 10px zero ; height : 60px ; line-height : 40px ; }
}
< div class = "show-yf" id = "skin" >
< a href = "javascript:;" id = "white" class = "qey" title = Light > light colour < / a >
< a href = "javascript:;" id = "black" class = "sey" title = Dark > Dark < / a >
< / div >
< script >
$("#yifu").click(
function(){
$(".show-yf").slideToggle();
});
< / script >