通过body.scrollTop(推荐):

document.body.scrollTop = 0通过元素的scrollIntoView()方法:

ele.scrollIntoView()通过内部链接:

<a href="#top">滚动到顶部</a>通过scrollBy()方法:

window.scrollBy(0,offset)