Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 HTML 页面每隔几秒钟就会通过底部的新内容动态增长。我希望用户总是看到页面底部。可以用jQuery来做吗?我每 100 毫秒尝试一次此代码段,但无法正常工作:
$("html, body").animate({scrollTop: $(document).height()}, 500);
尝试这个
setInterval(function(){ $("html, body").animate({ scrollTop: $(document).height() }, 100); },100);
jsFiddle 演示