I'm currently developing a website for an university course (Link: http://divedesigns.com/demo/btw17) and there's an issue I'm not able to solve on my own. I have a "back-to-top" button. With jQuery it lets the page scroll up smoothly.
HTML
<a id="back-to-top" href="#"><i class="fa fa-chevron-circle-up" aria-hidden="true"></i></a>
The following code in my script.js file works fine on the homepage of my website. Unfortunately this doesn't work on any of my subpages.
jQuery
$("#back-to-top").click(function(e){
e.preventDefault();
$("html, body").animate({scrollTop: "0"});
});
Do you have any suggestions?
` tag)
– Dipiks Jan 27 '17 at 15:46