【问题标题】:Cropper.js only enable zoomCropper.js 只启用缩放
【发布时间】:2020-07-07 14:45:33
【问题描述】:

是否可以禁用所有裁剪器功能并仅启用 cropper.zoom() 例如?

如果我使用 cropper.disable() 禁用裁剪器,它会禁用所有内容。

【问题讨论】:

    标签: javascript cropperjs


    【解决方案1】:

    从源代码看来,这个选项不被支持:

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

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

    您可以打开一个问题或自己做...

    【讨论】:

      【解决方案2】:

      一种可能的方法是像这样设置这些选项:

      autoCrop: false,
      dragMode: 'move
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-11-13
        • 1970-01-01
        • 1970-01-01
        • 2013-02-09
        • 1970-01-01
        • 2013-02-24
        • 2019-01-22
        • 1970-01-01
        相关资源
        最近更新 更多