diff --git a/layouts/partials/page_footer.html b/layouts/partials/page_footer.html index 24ce455..1ad0e41 100644 --- a/layouts/partials/page_footer.html +++ b/layouts/partials/page_footer.html @@ -60,6 +60,10 @@ if (!enableTocScroll) { return } + if (!document.querySelector('.toc')) { + console.log('no toc found, ignore toc scroll') + return + } // console.log('enable toc scroll') // always get an array here