diff options
Diffstat (limited to 'assets/menu-reset.js')
-rw-r--r-- | assets/menu-reset.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/assets/menu-reset.js b/assets/menu-reset.js new file mode 100644 index 0000000..f3b90c5 --- /dev/null +++ b/assets/menu-reset.js @@ -0,0 +1,7 @@ +(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"); +})(); |