javascriptcropperjs

Cropper.js only enable zoom


Is it possible to disable all cropper functionality and only enable cropper.zoom() for example?

If I disable cropper with cropper.disable() it disables everything.


Solution

  • From the source code it’s seems that this option isn’t supported:

      // Disable (freeze) the cropper
      disable() {
        if (this.ready && !this.disabled) {
          this.disabled = true;
          addClass(this.cropper, CLASS_DISABLED);
        }
    
        return this;
      },
    

    Source: https://github.com/fengyuanchen/cropperjs/blob/89f0b50c7f580135582a087cbf2417126b67d5fd/src/js/methods.js#L137

    You can open an issue or do it yourself...