如何做到有滚动条的div,通过jQuery滚动到指定元素的位置

var container = $('div'),
var 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 on 2018-12-16 10:28  扯。  阅读(5214)  评论(0编辑  收藏  举报

导航