code: function drag(e) {
        e.preventDefault();
  
        // Calculate how far the user's mouse is from the top/left of the scrollbar (minus the dragOffset).
        var eventOffset = e.pageY;
        if (scrollDirection === 'horiz') {
          eventOffset = e.pageX;
        }
        var dragPos = eventOffset - $scrollbarEl.offset()[offsetAttr] - dragOffset;
        // Convert the mouse position into a percentage of the scrollbar height/width.
        var dragPerc = dragPos / $scrollbarEl[sizeAttr]();
        // Scroll the content by the same percentage.
        var scrollPos = dragPerc * $contentEl[sizeAttr]();
  
        $scrollContentEl[scrollOffsetAttr](scrollPos);
      }
docs: Drag scrollbar handle