I have a simple jQuery script that allows for smooth navigation through a website using animated scrolling.
jQuery(".main_menu li a").click(function() {
var href = jQuery(this).attr('href');
if(jQuery(this).html() == 'Home') {
jQuery("html, body").animate({ scrollTop: jQuery('body').offset().top }, 1000);
}
else {
jQuery("html, body").animate({ scrollTop: jQuery(href).offset().top }, 1000);
}
return false;
});
Recently, after making some unrelated changes to the CSS and template of the website, the scrolling functionality suddenly stopped working. Now, I can only scroll to the top of the page by clicking on "Home". Even running the scrolling code in the console doesn't seem to help. I've tried undoing the recent changes, but the issue persists, leaving me puzzled and searching for a solution.
Here's the live version.