var $view = $('html,body'),$backTop = $('#backTop'),
$backTop.on('click',function(){ $view.animate({ 'scrollTop':0 },200); });
核心代码:
$("#id").animate({scrollTop:0},200)
适用场景:
<div class="moreRomm" style="background-color:#4990e2;"><a href="javascript:void(0)" onclick="$('#company_Tree').animate({scrollTop:0},200);"><span>返回页面顶部</span></a></div>
方法二:
$('html, body').animate({scrollTop:0}, 'slow');