[a43cea]: / modas / utils / assets / js / test.js

Download this file

36 lines (33 with data), 1.1 kB

 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
$(function() {
function clickNav(event) {
var target = event.currentTarget;
var tab = $(target).attr("href");
// console.log(tab);
$('a[href="' + tab + '"]').tab('show');
$(tab).tab('show');
if ($("a[role='tab']")) {
var arrLink = $("a[role='tab']");
for (i = 0; i < arrLink.length; i++) {
var link = arrLink[i];
if (link.classList.contains('active')) {
link.classList.remove('active');
}
}
}
target.classList.add('active');
}
$(".collapse").on('show.bs.collapse', function() {
$(this).prev(".qtlItem").find(".fa").removeClass("fa-plus").addClass("fa-minus");
}).on('hide.bs.collapse', function() {
$(this).prev(".qtlItem").find(".fa").removeClass("fa-minus").addClass("fa-plus");
$(this).prev(".qtlItem").removeClass("active");
});
if ($("a[role='tab']")) {
var arrLink = $("a[role='tab']");
for (i = 0; i < arrLink.length; i++) {
var link = arrLink[i];
link.classList.remove('active');
link.onclick = clickNav;
}
}
});