code: function _itemsPerPage() {
              var itemsPerPage = 1,
                  $items = self.$hintMenu.find("li"),
                  $view = self.$hintMenu.find("ul.dropdown-menu"),
                  itemHeight;
  
              if ($items.length !== 0) {
                  itemHeight = $($items[0]).height();
                  if (itemHeight) {
                      // round down to integer value
                      itemsPerPage = Math.floor($view.height() / itemHeight);
                      itemsPerPage = Math.max(1, Math.min(itemsPerPage, $items.length));
                  }
              }
  
              return itemsPerPage;
          }
docs: Calculate the number of items per scroll page.