I am trying to implement the scroll to top feature in my website: www.arrow-tvseries.com.
The \"button\" is seen on the website however it does not work properly, becaus
The problem is that your javascript file is actually written in HTML.
In your HTML head
section, you should have:
Then your back_to_top.js
should contain only the following:
$(function() {
$(window).scroll(function() {
if($(this).scrollTop() != 200) {
$('#backtotop').fadeIn();
} else {
$('#backtotop').fadeOut();
}
});
$('#backtotop').click(function() {
$('body,html').animate({scrollTop:0},800);
});
});