showing results for - "scroll to element in scrollable div"
Johanna
05 Apr 2018
1function scrollInDiv($scrollableDiv, $scrollTo, animate = true) {
2    var scrollTo =
3      $scrollTo.offset().top +
4      $scrollableDiv.scrollTop() -
5      $scrollableDiv.offset().top;
6    if (animate)
7      $scrollableDiv.animate({
8        scrollTop: scrollTo,
9      });
10    else $scrollableDiv.scrollTop(scrollTo);
11}