Add toggle toc button

This commit is contained in:
Track3 committed 2018-12-28 22:52:23 +08:00
1 parent 2b5999616d
commit 98c3c64499
3 files changed
+29 -5

No files matched your search

+8 -2
View File
@@ -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();
}