diff options
Diffstat (limited to 'templates/partials/doc')
-rw-r--r-- | templates/partials/doc/toc_script.html | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/templates/partials/doc/toc_script.html b/templates/partials/doc/toc_script.html index df115b0..1453a69 100644 --- a/templates/partials/doc/toc_script.html +++ b/templates/partials/doc/toc_script.html @@ -11,11 +11,13 @@ const navSections = new Array(tocItems.length); */ window.addEventListener('scroll', function() { - if (window.scrollY >= menuBarHeight) { - document.getElementById('main-toc-menu').classList.add('fixed', 'top-0', 'left-0'); - document.getElementById('main-toc-menu').style.width = mainTocMenuWidth + 'px'; - } else { - document.getElementById('main-toc-menu').classList.remove('fixed', 'top-0', 'left-0'); + if (window.screen.width >= 1280) { + if (window.scrollY >= menuBarHeight) { + document.getElementById('main-toc-menu').classList.add('fixed', 'top-0', 'left-0'); + document.getElementById('main-toc-menu').style.width = mainTocMenuWidth + 'px'; + } else { + document.getElementById('main-toc-menu').classList.remove('fixed', 'top-0', 'left-0'); + } } }); |