-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
54 lines (30 loc) · 1.06 KB
/
app.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
$(function () {
'use strict';
(function () {
var aside = $('.side-nav'),
showAsideBtn = $('.show-side-btn'),
contents = $('#contents');
showAsideBtn.on("click", function () {
$("#" + $(this).data('show')).toggleClass('show-side-nav');
contents.toggleClass('margin');
});
if ($(window).width() <= 767) {
aside.addClass('show-side-nav');
}
$(window).on('resize', function () {
if ($(window).width() > 767) {
aside.removeClass('show-side-nav');
}
});
// dropdown menu in the side nav
var slideNavDropdown = $('.side-nav-dropdown');
$('.side-nav .categories li').on('click', function () {
$(this).toggleClass('opend').siblings().removeClass('opend');
if ($(this).hasClass('opend')) {
$(this).find('.side-nav-dropdown').slideToggle('fast');
$(this).siblings().find('.side-nav-dropdown').slideUp('fast');
} else {
}
})
})
});