|
|
|
@ -104,10 +104,26 @@ function initMemberLogos() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
function initHonorsToggle() { |
|
|
|
const list = document.querySelector(".ab-honors__list"); |
|
|
|
const btn = document.querySelector(".ab-honors__more"); |
|
|
|
if (!list || !btn) return; |
|
|
|
const items = list.querySelectorAll(".ab-honors__item"); |
|
|
|
if (items.length <= 5) { |
|
|
|
btn.style.display = "none"; |
|
|
|
return; |
|
|
|
} |
|
|
|
btn.addEventListener("click", () => { |
|
|
|
const expanded = list.classList.toggle("is-expanded"); |
|
|
|
btn.classList.toggle("is-expanded", expanded); |
|
|
|
btn.querySelector("span").textContent = expanded ? "收起" : "展开更多"; |
|
|
|
}); |
|
|
|
} |
|
|
|
$(function() { |
|
|
|
setActiveNav(); |
|
|
|
initHistorySwiper(); |
|
|
|
initMemberLogos(); |
|
|
|
counterUpInit(); |
|
|
|
initHonorsToggle(); |
|
|
|
}); |
|
|
|
//#endregion
|