Answers for "jquery scroll to top with animation"

1

jquery scroll to top of div animate

$("#yourDivID").animate({scrollTop:0}, "smooth");
Posted by: Guest on January-19-2021
0

back to top scroll animation jquery

$(function() {
    $(window).scroll(function() {
        if($(this).scrollTop() != 0) {
            $('#toTop').fadeIn();    
        } else {
            $('#toTop').fadeOut();
        }
    });

    $('#toTop').click(function() {
        $('body,html').animate({scrollTop:0},800);
    });    
});​
Posted by: Guest on September-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language