Date: 2021-08-04 17:49:09, Hit: 198
$(function(){

    $(window).scroll(function(){
        var w_height = $(window).height();
        var scroll_top = $(document).scrollTop();
        if(scroll_top > w_height){
            $("#goto-top").fadeIn(500);
        }else{
            $("#goto-top").fadeOut(500);
        }
    });

    $("#goto-top").click(function(e){
        e.preventDefault();
        $(document.documentElement).animate({
            scrollTop: 0
        },200);
        //支持chrome
        $(document.body).animate({
            scrollTop: 0
        },200);
    });
})
Edit Delete
License by Moony