hugo-book-theme/assets/menu-reset.js

8 lines
260 B
JavaScript
Raw Permalink Normal View History

(function() {
var menu = document.querySelector("aside.book-menu nav");
addEventListener("beforeunload", function(event) {
localStorage.setItem("menu.scrollTop", menu.scrollTop);
});
menu.scrollTop = localStorage.getItem("menu.scrollTop");
})();