Answer the question
In order to leave comments, you need to log in
How to set scroll to footer?
Hello everyone, the following code snippet smoothly moves us to the top on click:
$('.scrollup').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
Answer the question
In order to leave comments, you need to log in
Here is the solution:
$('.scrolldown, .scrollup').on('click', function(event) {
event.preventDefault();
var sc = $(this).attr("href"),
dn = $( sc).offset().top;
$('html, body').animate({scrollTop: dn}, 600);
});
The same, almost, only for the #footer (or whatever you want to call it) scroll animation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question