Ant*_*ony 13 javascript scroll google-chrome
有没有办法禁用某些现代浏览器(Chrome和Safari)在页面刷新时记住滚动位置的行为?
小智 27
对于支持history.scrollRestoration的浏览器,可以关闭自动滚动行为:
if ('scrollRestoration' in history) {
history.scrollRestoration = 'manual';
}
Run Code Online (Sandbox Code Playgroud)
来源:https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration
归档时间: |
|
查看次数: |
17719 次 |
最近记录: |