src/core/element.js
/**
   * Brings the element to middle of the view port if not in view
   */
Brings the element to middle of the view port if not in view
Brings the element to middle of the view port if not in view
bringInView() {
    if (this.isInView()) {
      return;
    }
    if (!this.node.scrollIntoView) {
      this.scrollManually();
      return;
    }
    try {
      this.node.scrollIntoView(this.options.scrollIntoViewOptions || {
        behavior: 'smooth',
        block: 'center',
      });
    } catch (e) {
      this.scrollManually();
    }
  }
bringInView ( ) { if ( this . isInView ( ) ) { return ; } if ( ! this . node . scrollIntoView ) { this . scrollManually ( ) ; return ; } try { this . node . scrollIntoView ( this . options . scrollIntoViewOptions || { behavior : 'smooth' , block : 'center' , } ) ; } catch ( e ) { this . scrollManually ( ) ; } }
Brings the element to middle of the view port if not in view
Brings the element to middle of the view port if not in view
// If browser does not support scrollIntoView // `block` option is not allowed in older versions of firefox, scroll manually