|
|
|
@ -47,9 +47,24 @@ function initLearnItemClick() { |
|
|
|
if (href) window.location.href = href; |
|
|
|
}); |
|
|
|
} |
|
|
|
function initLearnToggle() { |
|
|
|
const list = document.querySelector(".iv-learn__list"); |
|
|
|
const btn = document.querySelector(".iv-learn__more"); |
|
|
|
if (!list || !btn) return; |
|
|
|
const items = list.querySelectorAll(".iv-learn__item"); |
|
|
|
if (items.length <= 6) { |
|
|
|
btn.style.display = "none"; |
|
|
|
return; |
|
|
|
} |
|
|
|
btn.addEventListener("click", () => { |
|
|
|
list.classList.toggle("is-expanded"); |
|
|
|
btn.classList.toggle("is-expanded"); |
|
|
|
}); |
|
|
|
} |
|
|
|
$(function() { |
|
|
|
setActiveNav(); |
|
|
|
initAnnounceSwiper(); |
|
|
|
initLearnItemClick(); |
|
|
|
initLearnToggle(); |
|
|
|
}); |
|
|
|
//#endregion
|