到相对应的元素位置。

setTimeout(function () {
document.getElementById("aa").scrollIntoView({
behavior: "smooth",
block: "start"
})
},500)
原文地址:https://www.cnblogs.com/cyzbeke/p/14950335.html