1.滚动到顶部:
a标签实现:<a href="#top">顶部</a>
js实现:location.href = "#top";
2.定位到指定dom元素:
$("#gun")[0].scrollIntoView();或者document.querySelector('#gun').scrollIntoView();
3.指定时间滚动到ID为gun的元素:
$("html,body").animate({scrollTop: $("#gun").offset().top}, 500);