code: function(i, scrollValue) {
        var rect;
        //Scrolling up
        if (scrollValue <= this.dimensions[i].primaryPos) {
          while ( (rect = this.dimensions[i - 1]) && rect.primaryPos > scrollValue) {
            i--;
          }
        //Scrolling down
        } else {
          while ( (rect = this.dimensions[i + 1]) && rect.primaryPos < scrollValue) {
            i++;
          }
        }
        return i;
      }
docs: /*
  getIndexForScrollValue: Given the most recent data index and a new scrollValue,
  find the data index that matches that scrollValue.
  
  Strategy (if we are scrolling down): keep going forward in the dimensions list,
  starting at the given index, until an item with height matching the new scrollValue
  is found.
  
  This is a while loop. In the worst case it will have to go through the whole list
  (eg to scroll from top to bottom).  The most common case is to scroll
  down 1-3 items at a time.
  
  While this is not as efficient as it could be, optimizing it gives no noticeable
  benefit.  We would have to use a new memory-intensive data structure for dimensions
  to fully optimize it.