xxxxxxxxxx
$(window).animate({
scrollTop: $(".divelementclass").offset().top
},400);
xxxxxxxxxx
$("my-element").click(function () {
$("html, body").animate({
scrollTop: 0
}, 1000)
})
xxxxxxxxxx
window.scrollTo({top: 0, behavior: 'smooth'});
reference : https://stackoverflow.com/questions/15935318/smooth-scroll-to-top
xxxxxxxxxx
$("#home_div").animate({scrollTop: $(window).scrollTop(0)}, 500);
xxxxxxxxxx
$(document).ready(function() {
// When the button is clicked
$('#scroll-to-top').click(function() {
// Animate scrolling to the top of the page
$('html, body').animate({ scrollTop: 0 }, 'slow');
});
});
xxxxxxxxxx
function goUp() {
window.scrollTo({
top: 0,
behavior: 'smooth'
});
}
xxxxxxxxxx
// Smooth scroll to top using jQuery
$('html, body').animate({ scrollTop: 0 }, 'slow');