RP_Rave1_theme/assets/js/toc.js

17 lines
586 B
JavaScript
Raw Permalink Normal View History

2025-01-10 10:27:58 +00:00
document.addEventListener("DOMContentLoaded", function () {
const tocToggle = document.getElementById("toc-toggle");
const tocContainer = document.getElementById("toc-container");
if (tocToggle && tocContainer) {
tocToggle.addEventListener("click", function () {
if (tocContainer.style.display === "none") {
tocContainer.style.display = "block";
tocToggle.textContent = "Tartalomjegyzék elrejtése";
} else {
tocContainer.style.display = "none";
tocToggle.textContent = "Tartalomjegyzék megjelenítése";
}
});
}
});