Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to destroy Croppie jQuery existing instance?

I've using Croppie jQuery Library for crop a image but facing a problem when it will create multiple instances.

I've found no documentation about destroy instance.

function initCrop() {
    var $uploadCrop;
    $('#image_crop').destroy();
    $uploadCrop = $('#image_crop').croppie({
        viewport: {
            width: WIDTH,
            height: HEIGHT,
            type: 'square'
        },
        boundary: {
            width: 798,
            height: 480
        },
        exif: true
    });
}
like image 617
Govind Samrow Avatar asked Jul 26 '16 07:07

Govind Samrow


1 Answers

Found a solution:

$('#image_crop').croppie('destroy');

For more detail refer Croppie.

like image 60
Govind Samrow Avatar answered Nov 07 '22 17:11

Govind Samrow