History.scrollRestoration属性允许 web 应用程序在历史导航上显式地设置默认滚动恢复行为,使用很简单,在页面的任意位置执行下面几行 JS 代码就可以了:
if (history.scrollRestoration) {
history.scrollRestoration = 'manual';
}
History.scrollRestoration属性允许 web 应用程序在历史导航上显式地设置默认滚动恢复行为,使用很简单,在页面的任意位置执行下面几行 JS 代码就可以了:
if (history.scrollRestoration) {
history.scrollRestoration = 'manual';
}