原網址: https://www.cnblogs.com/jaxu/archive/2013/05/17/3083019.html
這里有一個方法可以將DIV的滾動條滾動到其子元素所在的位置隧甚,方便自動定位府阀。
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()
});?