code: function updateNavButtonsState() {
              // Item navigation
              if (itemNav) {
                  var isFirst = rel.activeItem === 0,
                      isLast  = rel.activeItem >= items.length - 1,
                      itemsButtonState = isFirst ? 'first' : isLast ? 'last' : 'middle';
  
                  if (last.itemsButtonState !== itemsButtonState) {
                      last.itemsButtonState = itemsButtonState;
  
                      if ($prevButton.is('button,input')) {
                          $prevButton.prop('disabled', isFirst);
                      }
  
                      if ($nextButton.is('button,input')) {
                          $nextButton.prop('disabled', isLast);
                      }
  
                      $prevButton[isFirst ? 'removeClass' : 'addClass'](o.disabledClass);
                      $nextButton[isLast ? 'removeClass' : 'addClass'](o.disabledClass);
                  }
              }
  
              // Page navigation
              if ($pages[0]) {
                  var isStart = pos.dest <= pos.start,
                      isEnd = pos.dest >= pos.end,
                      pagesButtonState = isStart ? 'first' : isEnd ? 'last' : 'middle';
  
                  // Update paging buttons only if there has been a change in their state
                  if (last.pagesButtonState !== pagesButtonState) {
                      last.pagesButtonState = pagesButtonState;
  
                      if ($prevPageButton.is('button,input')) {
                          $prevPageButton.prop('disabled', isStart);
                      }
  
                      if ($nextPageButton.is('button,input')) {
                          $nextPageButton.prop('disabled', isEnd);
                      }
  
                      $prevPageButton[isStart ? 'removeClass' : 'addClass'](o.disabledClass);
                      $nextPageButton[isEnd ? 'removeClass' : 'addClass'](o.disabledClass);
                  }
              }
          }
docs: Disable navigation buttons when needed.
  
  Adds disabledClass, and when the button is <button> or <input>, activates :disabled state.
  
  @return {Void}