Update default.html

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2023-12-04 18:25:58 +01:00 committed by GitHub
parent 59ab5d323e
commit 234b28d871
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,7 +290,6 @@
var headerHeight = 200; // Height of the header var headerHeight = 200; // Height of the header
var footerHeight = 540; // Height of the footer var footerHeight = 540; // Height of the footer
var scrollTop = window.pageYOffset || document.documentElement.scrollTop; var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
var scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
var tocElement = document.querySelector('.toc-class'); var tocElement = document.querySelector('.toc-class');
if (scrollTop > headerHeight) { if (scrollTop > headerHeight) {
@ -298,6 +297,10 @@
} else { } else {
tocElement.style.top = headerHeight - scrollTop + 'px'; // Adjust based on scroll position tocElement.style.top = headerHeight - scrollTop + 'px'; // Adjust based on scroll position
} }
});
window.addEventListener('resize', function() {
var tocElement = document.querySelector('.toc-class');
if (window.innerWidth > 1600){ if (window.innerWidth > 1600){
tocElement.style.display = 'block'; // Show the navigation bar tocElement.style.display = 'block'; // Show the navigation bar