Update default.html
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
59ab5d323e
commit
234b28d871
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue