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);});

posted on 2014-06-06 10:50  欲上云端  阅读(1702)  评论(0编辑  收藏  举报