jquery滚动div到指定位置

 

原文地址:https://www.cnblogs.com/jaxu/archive/2013/05/17/3083019.html

var container = $('div'),
    scrollTo = $('#row_8');

container.scrollTop(
    scrollTo.offset().top - container.offset().top + container.scrollTop()
);

// Or you can animate the scrolling:
container.animate({
    scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop()
});​

 

posted @ 2020-04-11 14:42  _DC  阅读(1278)  评论(0编辑  收藏  举报