Currently, I am facing an issue with the smooth scroll feature on my website. Although I have implemented a to top arrow for users to move back to the top section of the page, the scrolling is not as smooth as intended.
The JavaScript code I used for achieving a smooth scroll effect is shown below:
$(function() {
$('a.page-scroll').bind('click', function(event) {
console.log("scroll");
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
However, despite implementing this script, the smooth scrolling is not functioning correctly. Here is the link to the jsfiddle where the issue can be observed: https://jsfiddle.net/36m5kp00/
In addition, the jQuery libraries that I have included in my project are:
<script src="scripts/controllers/jquery-ui.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>