Answers for "jquery animate scroll to top"

1

jquery scroll to top of div animate

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

jquery scrolltop animate

var body = $("html, body");
body.stop().animate({scrollTop:0}, 500, 'swing', function() { 
   alert("Finished animating");
});
Posted by: Guest on March-18-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