dist/viewer.common.js
function zoom(ratio) {
    var hasTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    var _originalEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

    var imageData = this.imageData;


    ratio = Number(ratio);

    if (ratio < 0) {
      ratio = 1 / (1 - ratio);
    } else {
      ratio = 1 + ratio;
    }

    this.zoomTo(imageData.width * ratio / imageData.naturalWidth, hasTooltip, _originalEvent);

    return this;
  }
function zoom(ratio) {
    var hasTooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    var _originalEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

    var imageData = this.imageData;


    ratio = Number(ratio);

    if (ratio < 0) {
      ratio = 1 / (1 - ratio);
    } else {
      ratio = 1 + ratio;
    }

    this.zoomTo(imageData.width * ratio / imageData.naturalWidth, hasTooltip, _originalEvent);

    return this;
  }
function zoom ( ratio ) { var hasTooltip = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : false ; var _originalEvent = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : null ; var imageData = this . imageData ; ratio = Number ( ratio ) ; if ( ratio < 0 ) { ratio = 1 / ( 1 - ratio ) ; } else { ratio = 1 + ratio ; } this . zoomTo ( imageData . width * ratio / imageData . naturalWidth , hasTooltip , _originalEvent ) ; return this ; }
Zoom the image with a relative ratio.
@param {number} ratio - The target ratio.
@param {boolean} [hasTooltip=false] - Indicates if it has a tooltip or not.
@param {Event} [_originalEvent=null] - The original event if any.
@returns {Viewer} this
Zoom the image with a relative ratio .