mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-31 03:45:24 +01:00 
			
		
		
		
	Add Smooth Scrolling
Thanks to Joseph Silber https://stackoverflow.com/a/7717572
This commit is contained in:
		 Joseph Silber
					Joseph Silber
				
			
				
					committed by
					
						 Aditya Telange
						Aditya Telange
					
				
			
			
				
	
			
			
			 Aditya Telange
						Aditya Telange
					
				
			
						parent
						
							16b98dc8f9
						
					
				
				
					commit
					163fa2d3f1
				
			| @@ -10,4 +10,13 @@ | ||||
| <script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script> | ||||
| <script> | ||||
|     hljs.initHighlightingOnLoad(); | ||||
|     document.querySelectorAll('a[href^="#"]').forEach(anchor => { | ||||
|         anchor.addEventListener("click", function (e) { | ||||
|             e.preventDefault(); | ||||
|  | ||||
|             document.querySelector(this.getAttribute("href")).scrollIntoView({ | ||||
|                 behavior: "smooth" | ||||
|             }); | ||||
|         }); | ||||
|     }); | ||||
| </script> | ||||
		Reference in New Issue
	
	Block a user