animate平滑回到顶部

Js:

//回到顶部
$(".totop").click(function () {
$("body,html").animate({scrollTop: 0}, 800);
return false;
});

原文地址:https://www.cnblogs.com/qiao20/p/5683541.html