使用JavaScript滚动到页面顶部吗?

落爺英雄遲暮 提交于 2020-08-12 06:02:08

问题:

How do I scroll to the top of the page using a JavaScript? 如何使用JavaScript滚动到页面顶部? It is desirable even if the scrollbar instantly jumps to the top. 即使滚动条立即跳到顶部也是可取的。 I'm not looking for a smooth scrolling. 我不是在寻找平滑的滚动。


解决方案:

参考一: https://stackoom.com/question/4nob/使用JavaScript滚动到页面顶部吗
参考二: https://oldbug.net/q/4nob/Scroll-to-the-top-of-the-page-using-JavaScript
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!