Add toggle toc button
This commit is contained in:
parent
2b5999616d
commit
98c3c64499
3 changed files with 29 additions and 5 deletions
|
@ -65,12 +65,18 @@ const showContent = () => {
|
|||
document.getElementById('bg-img').classList.remove('show-bg-img');
|
||||
}
|
||||
|
||||
// Toggle TOC
|
||||
//
|
||||
const toggleToc = () => {
|
||||
document.getElementById('toc').classList.toggle('show-toc');
|
||||
}
|
||||
|
||||
if (haveHeader == true) {
|
||||
document.getElementById('menu-btn').addEventListener('click', mobileMenuToggle);
|
||||
|
||||
|
||||
window.addEventListener('scroll', throttle(() => {
|
||||
autoHideHeader();
|
||||
|
||||
|
||||
if (mobileMenuVisible == true) {
|
||||
mobileMenuToggle();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue