demo/www/lib/ionic/js/ionic.bundle.js
function(left, top, animate, zoom, wasResize) {
    var self = this;

    // Stop deceleration
    if (self.__isDecelerating) {
      zyngaCore.effect.Animate.stop(self.__isDecelerating);
      self.__isDecelerating = false;
    }

    // Correct coordinates based on new zoom level
    if (zoom != null && zoom !== self.__zoomLevel) {

      if (!self.options.zooming) {
        throw new Error("Zooming is not enabled!");
      }

      left *= zoom;
      top *= zoom;

      // Recompute maximum values while temporary tweaking maximum scroll ranges
      self.__computeScrollMax(zoom);

    } else {

      // Keep zoom when not defined
      zoom = self.__zoomLevel;

    }

    if (!self.options.scrollingX) {

      left = self.__scrollLeft;

    } else {

      if (self.options.paging) {
        left = Math.round(left / self.__clientWidth) * self.__clientWidth;
      } else if (self.options.snapping) {
        left = Math.round(left / self.__snapWidth) * self.__snapWidth;
      }

    }

    if (!self.options.scrollingY) {

      top = self.__scrollTop;

    } else {

      if (self.options.paging) {
        top = Math.round(top / self.__clientHeight) * self.__clientHeight;
      } else if (self.options.snapping) {
        top = Math.round(top / self.__snapHeight) * self.__snapHeight;
      }

    }

    // Limit for allowed ranges
    left = Math.max(Math.min(self.__maxScrollLeft, left), 0);
    top = Math.max(Math.min(self.__maxScrollTop, top), 0);

    // Don't animate when no change detected, still call publish to make sure
    // that rendered position is really in-sync with internal data
    if (left === self.__scrollLeft && top === self.__scrollTop) {
      animate = false;
    }

    // Publish new values
    self.__publish(left, top, zoom, animate, wasResize);

  }
function(left, top, animate, zoom, wasResize) {
    var self = this;

    // Stop deceleration
    if (self.__isDecelerating) {
      zyngaCore.effect.Animate.stop(self.__isDecelerating);
      self.__isDecelerating = false;
    }

    // Correct coordinates based on new zoom level
    if (zoom != null && zoom !== self.__zoomLevel) {

      if (!self.options.zooming) {
        throw new Error("Zooming is not enabled!");
      }

      left *= zoom;
      top *= zoom;

      // Recompute maximum values while temporary tweaking maximum scroll ranges
      self.__computeScrollMax(zoom);

    } else {

      // Keep zoom when not defined
      zoom = self.__zoomLevel;

    }

    if (!self.options.scrollingX) {

      left = self.__scrollLeft;

    } else {

      if (self.options.paging) {
        left = Math.round(left / self.__clientWidth) * self.__clientWidth;
      } else if (self.options.snapping) {
        left = Math.round(left / self.__snapWidth) * self.__snapWidth;
      }

    }

    if (!self.options.scrollingY) {

      top = self.__scrollTop;

    } else {

      if (self.options.paging) {
        top = Math.round(top / self.__clientHeight) * self.__clientHeight;
      } else if (self.options.snapping) {
        top = Math.round(top / self.__snapHeight) * self.__snapHeight;
      }

    }

    // Limit for allowed ranges
    left = Math.max(Math.min(self.__maxScrollLeft, left), 0);
    top = Math.max(Math.min(self.__maxScrollTop, top), 0);

    // Don't animate when no change detected, still call publish to make sure
    // that rendered position is really in-sync with internal data
    if (left === self.__scrollLeft && top === self.__scrollTop) {
      animate = false;
    }

    // Publish new values
    self.__publish(left, top, zoom, animate, wasResize);

  }
function ( left , top , animate , zoom , wasResize ) { var self = this ; // Stop deceleration if ( self . __isDecelerating ) { zyngaCore . effect . Animate . stop ( self . __isDecelerating ) ; self . __isDecelerating = false ; } // Correct coordinates based on new zoom level if ( zoom != null && zoom !== self . __zoomLevel ) { if ( ! self . options . zooming ) { throw new Error ( "Zooming is not enabled!" ) ; } left *= zoom ; top *= zoom ; // Recompute maximum values while temporary tweaking maximum scroll ranges self . __computeScrollMax ( zoom ) ; } else { // Keep zoom when not defined zoom = self . __zoomLevel ; } if ( ! self . options . scrollingX ) { left = self . __scrollLeft ; } else { if ( self . options . paging ) { left = Math . round ( left / self . __clientWidth ) * self . __clientWidth ; } else if ( self . options . snapping ) { left = Math . round ( left / self . __snapWidth ) * self . __snapWidth ; } } if ( ! self . options . scrollingY ) { top = self . __scrollTop ; } else { if ( self . options . paging ) { top = Math . round ( top / self . __clientHeight ) * self . __clientHeight ; } else if ( self . options . snapping ) { top = Math . round ( top / self . __snapHeight ) * self . __snapHeight ; } } // Limit for allowed ranges left = Math . max ( Math . min ( self . __maxScrollLeft , left ) , 0 ) ; top = Math . max ( Math . min ( self . __maxScrollTop , top ) , 0 ) ; // Don't animate when no change detected, still call publish to make sure // that rendered position is really in-sync with internal data if ( left === self . __scrollLeft && top === self . __scrollTop ) { animate = false ; } // Publish new values self . __publish ( left , top , zoom , animate , wasResize ) ; }
Scrolls to the given position. Respect limitations and snapping automatically.

@param left {Number} Horizontal scroll position, keeps current if value is <code>null</code>
@param top {Number} Vertical scroll position, keeps current if value is <code>null</code>
@param animate {Boolean} Whether the scrolling should happen using an animation
@param zoom {Number} Zoom level to go to
Scrolls to the given position . Respect limitations and snapping automatically .