mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
690 B
JavaScript
17 lines
690 B
JavaScript
4 months ago
|
document.addEventListener('DOMContentLoaded', function () {
|
||
|
if (document.querySelectorAll('.tab-control a').length > 0) {
|
||
|
document.querySelectorAll('.tab-control a')?.forEach(function (el) {
|
||
|
el.addEventListener('click', function () {
|
||
|
try {
|
||
|
document.querySelector('.tab-control a.active').classList.remove('active');
|
||
|
this.classList.add('active');
|
||
|
document.querySelector('.tab.active').classList.remove('active');
|
||
|
document.querySelector(this.getAttribute('href')).classList.add('active');
|
||
|
} catch {
|
||
|
}
|
||
|
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
});
|