I have a list of elements within a overflow hidden div. So not all elements are visible. Now, if an element gets activated, it should become visible within the div.
You can set the scrollTop of the wrapper div to be the top
of the position of the active element.
$("#wrapper").scrollTop($("#wrapper").scrollTop() + $("div.element.active").position().top);
DEMO
Maybe you are looking for scrollIntoView method.
scrollToEl[0].scrollIntoView();
DEMO: http://jsfiddle.net/yuFk5/14/