-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyfunction.js
134 lines (127 loc) · 4.54 KB
/
myfunction.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
//tombol menampilkan sidebar
$(".msb").click(function() {
$("#sidebar").addClass("show-sidebar");
$(".msb").removeClass("show");
$("#sidebar").removeClass("hide-sidebar-lm");
$(".main").removeClass("add-main-width");
$(".op-hide").addClass("op-show");
});
//tombol menyembunyikan sidebar
$(".hsb").click(function() {
$("#sidebar").removeClass("show-sidebar");
$("#sidebar").addClass("hide-sidebar-lm");
$(".main").addClass("add-main-width");
$(".msb").addClass("show");
$(".op-hide").removeClass("op-show");
});
//opacity saat memunculkan sidebar
$(".op-hide").click(function() {
$("#sidebar").removeClass("show-sidebar");
$("#sidebar").addClass("hide-sidebar-lm");
$(".main").addClass("add-main-width");
$(".msb").addClass("show");
$(".op-hide").removeClass("op-show");
});
//fungsi collapse saat mengklik salah satu menu
$(window).resize(function() {
if ($(window).width() < 992) {
$('li a').click(function() {
$('#sidebar').css('left', '0');
$('#sidebar').removeClass('show-sidebar');
$("#sidebar").addClass("hide-sidebar-lm");
$(".op-hide").removeClass("op-show");
});
} else {
$('li a').click(function() {
$('#sidebar').css('left', '0');
$('#sidebar').addClass('show-sidebar');
$("#sidebar").removeClass("hide-sidebar-lm");
$(".op-hide").removeClass("op-show");
});
}
});
// bagian-bagian pergatian halaman active
$("#dashboard").click(function() {
$("#dashboard").addClass("active");
$("#article").removeClass("active");
$("#gallery").removeClass("active");
$("#user").removeClass("active");
$("#theme").removeClass("active");
$("#tag").removeClass("active");
$("#m-dashboard").removeClass("hide");
$("#m-article").addClass("hide");
$("#m-gallery").addClass("hide");
$("#m-user").addClass("hide");
$("#m-theme").addClass("hide");
$("#m-tag").addClass("hide");
});
$("#article, #article-box").click(function() {
$("#dashboard").removeClass("active");
$("#article").addClass("active");
$("#gallery").removeClass("active");
$("#user").removeClass("active");
$("#theme").removeClass("active");
$("#tag").removeClass("active");
$("#m-dashboard").addClass("hide");
$("#m-article").removeClass("hide");
$("#m-gallery").addClass("hide");
$("#m-user").addClass("hide");
$("#m-theme").addClass("hide");
$("#m-tag").addClass("hide");
});
$("#gallery").click(function() {
$("#dashboard").removeClass("active");
$("#article").removeClass("active");
$("#gallery").addClass("active");
$("#user").removeClass("active");
$("#theme").removeClass("active");
$("#tag").removeClass("active");
$("#m-dashboard").addClass("hide");
$("#m-article").addClass("hide");
$("#m-gallery").removeClass("hide");
$("#m-user").addClass("hide");
$("#m-theme").addClass("hide");
$("#m-tag").addClass("hide");
});
$("#tag").click(function() {
$("#dashboard").removeClass("active");
$("#article").removeClass("active");
$("#gallery").removeClass("active");
$("#user").removeClass("active");
$("#theme").removeClass("active");
$("#tag").addClass("active");
$("#m-dashboard").addClass("hide");
$("#m-article").addClass("hide");
$("#m-gallery").addClass("hide");
$("#m-user").addClass("hide");
$("#m-theme").addClass("hide");
$("#m-tag").removeClass("hide");
});
$("#user").click(function() {
$("#dashboard").removeClass("active");
$("#article").removeClass("active");
$("#gallery").removeClass("active");
$("#user").addClass("active");
$("#theme").removeClass("active");
$("#tag").removeClass("active");
$("#m-dashboard").addClass("hide");
$("#m-article").addClass("hide");
$("#m-gallery").addClass("hide");
$("#m-user").removeClass("hide");
$("#m-theme").addClass("hide");
$("#m-tag").addClass("hide");
});
$("#theme").click(function() {
$("#dashboard").removeClass("active");
$("#article").removeClass("active");
$("#gallery").removeClass("active");
$("#user").removeClass("active");
$("#theme").addClass("active");
$("#tag").removeClass("active");
$("#m-dashboard").addClass("hide");
$("#m-article").addClass("hide");
$("#m-gallery").addClass("hide");
$("#m-user").addClass("hide");
$("#m-theme").removeClass("hide");
$("#m-tag").addClass("hide");
});