src/core/util/util.js
function(element, scrollEnd, duration) {
      var scrollStart = element.scrollTop;
      var scrollChange = scrollEnd - scrollStart;
      var scrollingDown = scrollStart < scrollEnd;
      var startTime = $mdUtil.now();

      $$rAF(scrollChunk);

      function scrollChunk() {
        var newPosition = calculateNewPosition();

        element.scrollTop = newPosition;

        if (scrollingDown ? newPosition < scrollEnd : newPosition > scrollEnd) {
          $$rAF(scrollChunk);
        }
      }

      function calculateNewPosition() {
        var easeDuration = duration || 1000;
        var currentTime = $mdUtil.now() - startTime;

        return ease(currentTime, scrollStart, scrollChange, easeDuration);
      }

      function ease(currentTime, start, change, duration) {
        // If the duration has passed (which can occur if our app loses focus due to $$rAF), jump
        // straight to the proper position
        if (currentTime > duration) {
          return start + change;
        }

        var ts = (currentTime /= duration) * currentTime;
        var tc = ts * currentTime;

        return start + change * (-2 * tc + 3 * ts);
      }
    }
function(element, scrollEnd, duration) {
      var scrollStart = element.scrollTop;
      var scrollChange = scrollEnd - scrollStart;
      var scrollingDown = scrollStart < scrollEnd;
      var startTime = $mdUtil.now();

      $$rAF(scrollChunk);

      function scrollChunk() {
        var newPosition = calculateNewPosition();

        element.scrollTop = newPosition;

        if (scrollingDown ? newPosition < scrollEnd : newPosition > scrollEnd) {
          $$rAF(scrollChunk);
        }
      }

      function calculateNewPosition() {
        var easeDuration = duration || 1000;
        var currentTime = $mdUtil.now() - startTime;

        return ease(currentTime, scrollStart, scrollChange, easeDuration);
      }

      function ease(currentTime, start, change, duration) {
        // If the duration has passed (which can occur if our app loses focus due to $$rAF), jump
        // straight to the proper position
        if (currentTime > duration) {
          return start + change;
        }

        var ts = (currentTime /= duration) * currentTime;
        var tc = ts * currentTime;

        return start + change * (-2 * tc + 3 * ts);
      }
    }
function ( element , scrollEnd , duration ) { var scrollStart = element . scrollTop ; var scrollChange = scrollEnd - scrollStart ; var scrollingDown = scrollStart < scrollEnd ; var startTime = $mdUtil . now ( ) ; $$rAF ( scrollChunk ) ; function scrollChunk ( ) { var newPosition = calculateNewPosition ( ) ; element . scrollTop = newPosition ; if ( scrollingDown ? newPosition < scrollEnd : newPosition > scrollEnd ) { $$rAF ( scrollChunk ) ; } } function calculateNewPosition ( ) { var easeDuration = duration || 1000 ; var currentTime = $mdUtil . now ( ) - startTime ; return ease ( currentTime , scrollStart , scrollChange , easeDuration ) ; } function ease ( currentTime , start , change , duration ) { // If the duration has passed (which can occur if our app loses focus due to $$rAF), jump // straight to the proper position if ( currentTime > duration ) { return start + change ; } var ts = ( currentTime /= duration ) * currentTime ; var tc = ts * currentTime ; return start + change * ( - 2 * tc + 3 * ts ) ; } }
Animate the requested element's scrollTop to the requested scrollPosition with basic easing.

@param {!Element} element The element to scroll.
@param {number} scrollEnd The new/final scroll position.
@param {number=} duration Duration of the scroll. Default is 1000ms.
Animate the requested element s scrollTop to the requested scrollPosition with basic easing .