summaryrefslogtreecommitdiff
path: root/layouts/partials/footer.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/footer.html')
-rw-r--r--layouts/partials/footer.html8
1 files changed, 8 insertions, 0 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 85e7273..12c7908 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -16,6 +16,11 @@
{{ $highlight := resources.Get "js/highlight.min.js" | minify | fingerprint}}
<script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script>
<script>
+ window.onload = function () {
+ if (localStorage.getItem("menu-scroll-position")) {
+ document.getElementById('menu').scrollLeft = localStorage.getItem("menu-scroll-position");
+ }
+ }
hljs.initHighlightingOnLoad();
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener("click", function (e) {
@@ -36,4 +41,7 @@
mybutton.style.opacity = "0";
}
};
+ function menu_on_scroll() {
+ localStorage.setItem("menu-scroll-position", document.getElementById('menu').scrollLeft);
+ }
</script> \ No newline at end of file