Add prev and next chapter navigation

This commit is contained in:
2023-04-01 23:36:53 -07:00
parent 58e81517cd
commit 29a085d789
4 changed files with 127 additions and 13 deletions
+19
View File
@@ -0,0 +1,19 @@
<script>
// When the user scrolls the page, execute myFunction
window.onscroll = function() {headerscroll()};
// Get the header
var header = document.getElementById("NavHeader");
// Get the offset position of the navbar
var sticky = header.offsetTop;
// Add the sticky class to the header when you reach its scroll position. Remove "sticky" when you leave the scroll position
function headerscroll() {
if (window.pageYOffset > sticky) {
header.classList.add("sticky");
} else {
header.classList.remove("sticky");
}
}
</script>