var container = $(‘.option‘),
scrollTo = $(".checktype").children("li").eq(highlightindex);
container.scrollTop(
scrollTo.offset().top - container.offset().top + container.scrollTop()
);
原文地址:http://www.cnblogs.com/afei-happy/p/3910248.html