mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-30 19:35:26 +01:00 
			
		
		
		
	Check if menu exists before using scroll position logic
				
					
				
			This commit is contained in:
		| @@ -25,9 +25,11 @@ | |||||||
|  |  | ||||||
| <script> | <script> | ||||||
|     let menu = document.getElementById('menu') |     let menu = document.getElementById('menu') | ||||||
|     menu.scrollLeft = localStorage.getItem("menu-scroll-position"); |     if (menu) { | ||||||
|     menu.onscroll = function () { |         menu.scrollLeft = localStorage.getItem("menu-scroll-position"); | ||||||
|         localStorage.setItem("menu-scroll-position", menu.scrollLeft); |         menu.onscroll = function () { | ||||||
|  |             localStorage.setItem("menu-scroll-position", menu.scrollLeft); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     document.querySelectorAll('a[href^="#"]').forEach(anchor => { |     document.querySelectorAll('a[href^="#"]').forEach(anchor => { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Aditya Telange
					Aditya Telange