pagelets/nodejitsu/anchor/base.js
function animate() {
    var diff = this.speed;

    //
    // If we're getting close to the endpoint stop at 0.
    //
    if (this.delta < diff) {
      clearInterval(this.animated);
      diff = this.delta;
    }

    //
    // Keep track of how much is scrolled.
    //
    this.delta = this.delta - diff;
    this.y = this.y + diff * this.direction;

    //
    // Animate the scroll position.
    //
    window.scrollTo(0, this.y);
  }
function animate() {
    var diff = this.speed;

    //
    // If we're getting close to the endpoint stop at 0.
    //
    if (this.delta < diff) {
      clearInterval(this.animated);
      diff = this.delta;
    }

    //
    // Keep track of how much is scrolled.
    //
    this.delta = this.delta - diff;
    this.y = this.y + diff * this.direction;

    //
    // Animate the scroll position.
    //
    window.scrollTo(0, this.y);
  }
function animate ( ) { var diff = this . speed ; // // If we're getting close to the endpoint stop at 0. // if ( this . delta < diff ) { clearInterval ( this . animated ) ; diff = this . delta ; } // // Keep track of how much is scrolled. // this . delta = this . delta - diff ; this . y = this . y + diff * this . direction ; // // Animate the scroll position. // window . scrollTo ( 0 , this . y ) ; }
Calculations for the animation.

@api private
Calculations for the animation .