code: function scrollIfAnchor(href, pushToHistory) {
        var match, rect, anchorOffset;
  
        if (!ANCHOR_REGEX.test(href)) {
          return false;
        }
  
        match = document.getElementById(href.slice(1));
  
        if (match) {
          rect = match.getBoundingClientRect();
          anchorOffset = window.pageYOffset + rect.top - getFixedOffset();
          window.scrollTo(window.pageXOffset, anchorOffset);
  
          // Add the state to history as-per normal anchor links
          if (HISTORY_SUPPORT && pushToHistory) {
            history.pushState({}, document.title, location.pathname + href);
          }
        }
  
        return !!match;
      }
docs: If the provided href is an anchor which resolves to an element on the
  page, scroll to it.
  @param  {String} href
  @return {Boolean} - Was the href an anchor.