I have tested smooth script and do not know why simple code is not detected. How to manage # as clicked links should not show up #1@#%^-bottom inside URL.
Source: Chris Ferdinandi: https://github.com/cferdinandi/smooth-scroll
Demo version: https://codepen.io/cferdinandi/pen/wQzrdM
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>CodePen - CSS Smooth Scroll Demo</title>
<script src="js/smooth-scroll.polyfills.min.js"></script>
<script src="js/javascript.js"></script>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<p id="top">
<a href="#bazinga">Go to the middle</a><br>
<a href="#1@#%^-bottom">Go to the bottom</a>
</p>
<p>
.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>
.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>
.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.
</p>
<p id="bazinga"><a href="#1@#%^-bottom">Go to the bottom</a></p>
<p>
.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>
.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>
.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.
.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>
.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>
.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.<br>.
</p>
<p id="1@#%^-bottom"><a href="#">Go back to the top</a></p>
<!-- partial -->
</body>
</html>
Javascript:
var scroll = new SmoothScroll('a[href*="#"]');