Answers for "back to top scroll animation jquery"

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