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

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


当前回答

就像这样:

var $target = $('html,body'); 
$target.animate({scrollTop: $target.height()}, 1000);

其他回答

js

var el = document.getElementById("el");
el.scrollTop = el.scrollHeight - el.scrollTop;

你可以试试这个

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

对我有用。卷轴到底。

使用“document.body。clientHeight'你可以得到身体元素的可见高度

$('html, body').animate({
    scrollTop: $("#particularDivision").offset().top - document.body.clientHeight + $("#particularDivision").height()
}, 1000);

这个滚动在id ' speciardivision '处

function scrollToBottom() {
     $("#mContainer").animate({ scrollTop: $("#mContainer")[0].scrollHeight }, 1000);
}

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