docs: function delegate (event) {
        if (!linkInPage(event.target)) {
          return;
        } else {
          event.preventDefault();
          event.stopPropagation();
  
          // Get element id:
          link = event.target.attributes.href.value.toString();
          elementId = link.substr(link.lastIndexOf('#') + 1);
  
          // Get values for the next scroll:
          if (element = document.getElementById(elementId)) {
            start = pageOffset();
            stop = top(element, start);
            distance = stop - start - settings.offset;
  
            if (settings.type === 'speed') {
              duration = Math.abs(distance / settings.speed) * 1000;
            } else if (settings.type === 'time') {
              duration = settings.time;
            }
          }
  
          // Start render:
          window.requestAnimationFrame(function (currentTime) {
            startTime = currentTime;
            render(currentTime);
          });
        }
      }