src/smoothscroll.js
function smoothScroll(el, x, y) {
    var scrollable;
    var startX;
    var startY;
    var method;
    var startTime = now();

    // define scroll context
    if (el === d.body) {
      scrollable = w;
      startX = w.scrollX || w.pageXOffset;
      startY = w.scrollY || w.pageYOffset;
      method = original.scroll;
    } else {
      scrollable = el;
      startX = el.scrollLeft;
      startY = el.scrollTop;
      method = scrollElement;
    }

    // scroll looping over a frame
    step({
      scrollable: scrollable,
      method: method,
      startTime: startTime,
      startX: startX,
      startY: startY,
      x: x,
      y: y
    });
  }
function smoothScroll(el, x, y) {
    var scrollable;
    var startX;
    var startY;
    var method;
    var startTime = now();

    // define scroll context
    if (el === d.body) {
      scrollable = w;
      startX = w.scrollX || w.pageXOffset;
      startY = w.scrollY || w.pageYOffset;
      method = original.scroll;
    } else {
      scrollable = el;
      startX = el.scrollLeft;
      startY = el.scrollTop;
      method = scrollElement;
    }

    // scroll looping over a frame
    step({
      scrollable: scrollable,
      method: method,
      startTime: startTime,
      startX: startX,
      startY: startY,
      x: x,
      y: y
    });
  }
function smoothScroll ( el , x , y ) { var scrollable ; var startX ; var startY ; var method ; var startTime = now ( ) ; // define scroll context if ( el === d . body ) { scrollable = w ; startX = w . scrollX || w . pageXOffset ; startY = w . scrollY || w . pageYOffset ; method = original . scroll ; } else { scrollable = el ; startX = el . scrollLeft ; startY = el . scrollTop ; method = scrollElement ; } // scroll looping over a frame step ( { scrollable : scrollable , method : method , startTime : startTime , startX : startX , startY : startY , x : x , y : y } ) ; }
scrolls window or element with a smooth behavior
@method smoothScroll
@param {Object|Node} el
@param {Number} x
@param {Number} y
@returns {undefined}
scrolls window or element with a smooth behavior