SHOW:
|
|
- or go back to the newest paste.
1 | // demo panel | |
2 | ||
3 | // this is for html code | |
4 | <!-- demo panel start --> | |
5 | <div class="control"> | |
6 | <span class="hide-pan0"><i class="fa fa-angle-right"></i></span> | |
7 | <span class="hide-pan00"><i class="fa fa-angle-left"></i></span> | |
8 | </div> | |
9 | <div class="demo-panel"> | |
10 | <h2>Demo Panel Color Scheme</h2> | |
11 | <ul> | |
12 | <li class="red-color"></li> | |
13 | <li class="green-color"></li> | |
14 | <li class="pink-color"></li> | |
15 | <li class="blue-color"></li> | |
16 | <li class="yellow-color"></li> | |
17 | <li class="black-color"></li> | |
18 | <li class="orange-color"></li> | |
19 | <li class="white-color"></li> | |
20 | </ul> | |
21 | </div> | |
22 | <!-- demo panel end --> | |
23 | ||
24 | ||
25 | ||
26 | ||
27 | ||
28 | // this is for css | |
29 | /* demo panel css*/ | |
30 | .demo-panel{width:250px;height:300px;background-color:#ccc;top:40px;left:0;z-index:9999;position:fixed;display:none;} | |
31 | .demo-panel ul{margin:10px 5px;padding:0;list-style:none;} | |
32 | .demo-panel ul li{width:40px;height:40px;display:inline-block;cursor:pointer;} | |
33 | .demo-panel ul li.red-color{background-color:red;} | |
34 | .demo-panel ul li.green-color{background-color:green;} | |
35 | .demo-panel ul li.pink-color{background-color:pink;} | |
36 | .demo-panel ul li.blue-color{background-color:blue;} | |
37 | .demo-panel ul li.yellow-color{background-color:yellow;} | |
38 | .demo-panel ul li.black-color{background-color:black;} | |
39 | .demo-panel ul li.orange-color{background-color:orange;} | |
40 | .demo-panel ul li.white-color{background-color:white;} | |
41 | .demo-panel ul li:hover{} | |
42 | .control span.hide-pan0{background-color: #000000;color: #FFFFFF;z-index:999;cursor: pointer;float: left;margin-left: -250px;padding:8px 18px;} | |
43 | .control span.hide-pan00{background-color:red;color:#fff;float:right;padding:8px 18px;cursor:pointer;display:none;} | |
44 | .control{left: 250px;position: fixed;z-index:999;top:40px;font-size:20px;} | |
45 | .control span.hide-pan0 i{} | |
46 | .display-none{display:none;transition:ease 0.9s all;} | |
47 | .display-block{display:block;transition:ease 0.9s all;} | |
48 | ||
49 | body.red-color{background-color:red;} | |
50 | body.green-color{background-color:green;} | |
51 | body.pink-color{background-color:pink;} | |
52 | body.blue-color{background-color:blue;} | |
53 | body.yellow-color{background-color:yellow;} | |
54 | body.black-color{background-color:black;} | |
55 | body.orange-color{background-color:orange;} | |
56 | body.white-color{background-color:white;} | |
57 | ||
58 | ||
59 | ||
60 | ||
61 | // this for js | |
62 | ||
63 | // Demo panel ja active | |
64 | ||
65 | $(document).ready(function(){ | |
66 | $('li.red-color').click(function(){ | |
67 | $('body').addClass('red-color').removeClass('green-color pink-color blue-color yellow-color black-color white-color'); | |
68 | }); | |
69 | ||
70 | $('li.green-color').click(function(){ | |
71 | $('body').addClass('green-color').removeClass('red-color pink-color blue-color yellow-color black-color orange-color white-color'); | |
72 | }); | |
73 | ||
74 | $('li.pink-color').click(function(){ | |
75 | $('body').addClass('pink-color').removeClass('red-color green-color blue-color yellow-color black-color orange-color white-color'); | |
76 | }); | |
77 | ||
78 | $('li.blue-color').click(function(){ | |
79 | $('body').addClass('blue-color').removeClass('red-color green-color pink-color yellow-color black-color orange-color white-color'); | |
80 | }); | |
81 | ||
82 | $('li.yellow-color').click(function(){ | |
83 | $('body').addClass('yellow-color').removeClass('red-color green-color pink-color blue-color black-color orange-color white-color'); | |
84 | }); | |
85 | ||
86 | $('li.black-color').click(function(){ | |
87 | $('body').addClass('black-color').removeClass('red-color green-color pink-color blue-color yellow-color orange-color white-color'); | |
88 | }); | |
89 | ||
90 | $('li.orange-color').click(function(){ | |
91 | $('body').addClass('orange-color').removeClass('red-color green-color pink-color blue-color yellow-color black-color white-color'); | |
92 | }); | |
93 | ||
94 | $('li.white-color').click(function(){ | |
95 | $('body').addClass('white-color').removeClass('red-color green-color pink-color blue-color yellow-color black-color orange-color'); | |
96 | }); | |
97 | ||
98 | // panel cross | |
99 | $('span.hide-pan0').click(function(){ | |
100 | $(this).hide(); | |
101 | $('span.hide-pan00').show(); | |
102 | $('.demo-panel').addClass('display-block').removeClass('display-none'); | |
103 | }); | |
104 | ||
105 | $('span.hide-pan00').click(function(){ | |
106 | $(this).hide(); | |
107 | $('span.hide-pan0').show(); | |
108 | $('.demo-panel').addClass('display-none').removeClass('display-block'); | |
109 | }); | |
110 | }); |