code: function updateScroll() {
        if (!self.element.li[0]) return;
        var height = self.element.li[0].offsetHeight,
          top = height * self.index,
          bot = top + height,
          hgt = self.element.scroller.clientHeight,
          scrollTop = self.element.scroller.scrollTop;
        if (top<scrollTop) {
          scrollTo(top);
        }else if (bot>scrollTop + hgt) {
          scrollTo(bot - hgt);
        }
      }
docs: Makes sure that the focused element is within view.