animate和scrollTop的使用

// 平滑滚动到ola结果位置
var scrollHeight = $("#wrap_div")[0].scrollHeight;
var curDivHeight = $("#"+userResultId).height();
$("#wrap_div").animate({scrollTop: (scrollHeight-curDivHeight+230)+"px"}, 500);

$this.animate({height: h}, 1000,function(){$("#wrap_div").animate({scrollTop: (scrollHeight-curDivHeight-180)+"px"}, 500);});

原文地址:https://www.cnblogs.com/Wen-yu-jing/p/3772092.html