document.getElementById(`idname`).scrollIntoView() 让id为idname的元素显示在页面之中,及也实现了,有滚动的情况,滚动条会滚动到相应位置 其兼容性