1. 页面结构

vue实现页内跳转功能

页面的结构如图所示,wrapper设为不允许滚动。content内容区允许滚动

2. 代码

document.getElementById("wrapper").scrollTop = document.getElementById("content").offsetTop - 150;


相关文章: