在我的页面完成加载后。我希望jQUery能够很好地滚动到页面的底部,快速生成动画,而不是一个快照/颠簸。

我需要像ScrollTo这样的插件吗?或者这是内置到jQuery的某种方式?


当前回答

$("div").scrollTop(1000);

对我有用。卷轴到底。

其他回答

你可以试试这个

var scroll=$('#scroll');
scroll.animate({scrollTop: scroll.prop("scrollHeight")});
$("div").scrollTop(1000);

对我有用。卷轴到底。

$('html,body').animate({ scrollTop: 9999 }, 'slow');

就这么简单,9999页高…范围大,所以可以到达底部。

js

var el = document.getElementById("el");
el.scrollTop = el.scrollHeight - el.scrollTop;
function scrollToBottom() {
     $("#mContainer").animate({ scrollTop: $("#mContainer")[0].scrollHeight }, 1000);
}

这是我和你们找到的解,我确定