jquery实现返回顶部效果

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

jQuery("#gotop").css('display','none');jQuery(window).scroll(function(){if(jQuery(this).scrollTop()>100){jQuery("#gotop").fadeIn(1000)}else{jQuery("#gotop").fadeOut(750)}});jQuery("#gotop").click(function(){jQuery("html, body").animate({scrollTop:0},300);return false})

滑动到一定距离,返回顶部按钮出现,点击后使用动画animate返回到顶部