You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Back to top$('a.top').click(function(e){e.preventDefault();$(document.body).animate({scrollTop: 0},800);});<!--Createananchortag--><aclass="top"href="#">Back to top</a>
通过使用 jQuery 中的 animate 和 scrollTop 方法,你无需插件便可创建一个简单地回到顶部动画:
将 scrollTop 的值改为你想要 scrollbar 停止的地方。然后你要做的就是,设置在 800 `毫秒内回到顶部。
The text was updated successfully, but these errors were encountered: