rimarima/themes/hugo-liftoff/assets/js/components/toc.js

12 lines
319 B
JavaScript
Raw Permalink Normal View History

2023-11-17 09:54:41 +00:00
const toggleToc = (() => {
let tocToggle = document.getElementById('js-toc-toggle');
let tocContents = document.getElementById('js-toc-contents');
if (tocToggle) {
tocToggle.addEventListener('click', () => {
tocContents.classList.toggle('toc-contents--active');
});
}
})();
export { toggleToc };