学习来源:https://www.bilibili.com/video/BV1a4411w7Gx
思路
1.使用animate动画返回顶部
2.animate动画函数里面有个scrollTop
属性,可以设置位置
3.但是是元素做动画(不是整个文档做动画),因此$("body, html").animate({ scrollTop: 0 })
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="jquery.min.js">