function scrollLocation(father, scrollTo) {
// father.scrollTop(
// scrollTo.offset().top - father.offset().top + father.scrollTop()
// );
// Or you can animate the scrolling:
father.animate({
scrollTop: scrollTo.offset().top - father.offset().top + father.scrollTop()
}, 1000);
};
var father= $('div'),
scrollTo= $('#row_8');
scrollLocation(father, scrollTo)
JQ实现将div的滚动条滚动到指定子元素所在的位置
最新推荐文章于 2024-06-18 10:31:04 发布