-
Notifications
You must be signed in to change notification settings - Fork 0
/
custom-style.js
32 lines (27 loc) · 1 KB
/
custom-style.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
jQuery(document).ready(function($) {
$('<div class="style-container">'+
'<ul class="pre-styles">'+
'<li class="default"></li>'+
'<li class="purple"></li>'+
'<li class="red"></li>'+
'<li class="blue"></li>'+
'<li class="cyan"></li>'+
'<li class="yellow"></li>'+
'</ul>'+
'<div id="demo-custom"><i class="icon-gear icon-spin"></i><h4>Color styles</h4></div>'+
'</div>').appendTo('body');
$(".style-container li").click(function(){
var selected = $(this).attr('class'),
style='css/styles/'+selected+'.css';
$('#theme-style').attr('href',style);
return false;
});
$("#demo-custom").click(function(){
if($(".style-container").css('right') == '0px'){
$(".style-container").stop().animate({right:'-205px'},300);
}
if($(".style-container").css('right') == '-205px'){
$(".style-container").stop().animate({right:'0px'},300);
}
});
});