【发布时间】:2017-04-21 00:53:43
【问题描述】:
我在使用 scrollTop 功能时遇到了问题。当单击 .scrollToComment 时,我尝试将滚动设置为 #comment,但不知道为什么它不起作用...
头:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js?ver=3.2.1"></script>
和滚动代码:
$(".scrollToComment").click(function() {
$('html, body').animate({
scrollTop: $("#comment").offset().top
}, 2000);
});
问题在于我开始新的小项目: http://katalogliquidow.mrqzi.webd.pl/
请帮忙。
【问题讨论】: