var active; active = $('.nav-main').find(".active"); $("#sidebar-scroll").scrollTop(active.offset().top);