code: function updateProgress() {
    var progressBar = document.querySelector('.progress-bar');
  
    if (progressBar !== null) {
      var numSlides = document.getElementsByClassName('slide').length;
      var position = currentPosition() - 1;
      var percent = (numSlides === 1) ? 100 : 100 * position / (numSlides - 1);
      progressBar.style.width = percent.toString() + '%';
    }
  }
docs: Sets the progress indicator.