extensions/amp-carousel/0.1/slidescroll.js
/**
   * Given an index, hides rest of the slides that are not needed.
   * @param {!Array<number>} indexArr Array of indices that
   *    should not be hidden.
   * @private
   */
Given an index, hides rest of the slides that are not needed.
@param {!Array} indexArr Array of indices that
should not be hidden.
@private
Given an index hides rest of the slides that are not needed . @param { !Array } indexArr Array of indices that should not be hidden . @private
hideRestOfTheSlides_(indexArr) {
    const noOfSlides_ = this.noOfSlides_;
    for (let i = 0; i < noOfSlides_; i++) {
      if (!this.slideWrappers_[i].classList.contains(SHOWN_CSS_CLASS)) {
        continue;
      }
      if (!indexArr.includes(i)) {
        if (this.shouldLoop) {
          setStyle(this.slideWrappers_[i], 'order', '');
        }
        this.slideWrappers_[i].classList.remove(SHOWN_CSS_CLASS);
        this.slides_[i].removeAttribute('aria-hidden');
      }
      if (this.slideIndex_ != i) {
        this.schedulePause(this.slides_[i]);
      }
    }
  }
hideRestOfTheSlides_ ( indexArr ) { const noOfSlides_ = this . noOfSlides_ ; for ( let i = 0 ; i < noOfSlides_ ; i ++ ) { if ( ! this . slideWrappers_ [ i ] . classList . contains ( SHOWN_CSS_CLASS ) ) { continue ; } if ( ! indexArr . includes ( i ) ) { if ( this . shouldLoop ) { setStyle ( this . slideWrappers_ [ i ] , 'order' , '' ) ; } this . slideWrappers_ [ i ] . classList . remove ( SHOWN_CSS_CLASS ) ; this . slides_ [ i ] . removeAttribute ( 'aria-hidden' ) ; } if ( this . slideIndex_ != i ) { this . schedulePause ( this . slides_ [ i ] ) ; } } }
Given an index, hides rest of the slides that are not needed.
Given an index hides rest of the slides that are not needed .
// Hide if not shown anymore // Pause if not the current slide