jquery - 动画滚动到顶部

标签 jquery html css scroll blogger

很抱歉重新发布这个问题,我认为我在其他帖子中没有说清楚。

我想做一个滚动到顶部的动画链接,就像这个网站底部的链接,http://www.thechrisellefactor.com/

我将如何去做/编写代码?我在编码方面没有太多经验,请注意,我正在学习:/

最佳答案

请查看这篇文章

Scroll to the top of the page using JavaScript/jQuery?

<script>
$(document).ready(function(){
 $("button").click(function(){
    window.scrollTo(0, 0);
  });
});
</script>

HTML

  <button>Return To TOP</button>

关于jquery - 动画滚动到顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26456232/

相关文章:

java - Web.xml 警告 "File name references to main that does not exist in web content"

html - CSS 格式问题?

javascript - 变量不能位于函数内部

html - CSS 垂直对齐问题

jquery - 数据表 colspan 标题

javascript - 如何在打开 Jquery SimpleModal 时添加动画?

css - 元缓存标记和 htaccess 缓存之间的区别?

html - 链接相对于列表的垂直高度偏移

jquery - 使用 SELECT 更改输入

javascript - AJAX GET 在第一次调用时返回未定义,但在第二次调用时有效