Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
    });    
});​
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #top #scroll #animation #jquery
ADD COMMENT
Topic
Name
5+9 =