Update default.html
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
de0239b29b
commit
7e18a17fb6
1 changed files with 7 additions and 0 deletions
|
@ -290,6 +290,7 @@
|
||||||
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) {
|
||||||
|
@ -297,6 +298,12 @@
|
||||||
} else {
|
} else {
|
||||||
tocElement.style.top = headerHeight - scrollTop + 'px'; // Adjust based on scroll position
|
tocElement.style.top = headerHeight - scrollTop + 'px'; // Adjust based on scroll position
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (window.innerWidth > scrollLeft){
|
||||||
|
tocElement.style.display = 'block'; // Show the navigation bar
|
||||||
|
} else {
|
||||||
|
tocElement.style.display = 'none'; // Hide the navigation bar
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue