如题:
$('.chat-wrapper').scrollTop($('.chat-wrapper')[0].scrollHeight); //当页面加载时滚动条滚到最下面
mCustomScrollbar是一个滚动条插件,使用前需要先初始化,下面是初始化的一种方式
$('.chat-wrapper').mCustomScrollbar();
$(document).ready(function(){
$('.chat-wrapper').mCustomScrollbar("scrollTo","bottom",{ scrollEasing : 'easeOut' });
});